diff options
Diffstat (limited to 'include/hardware')
-rw-r--r-- | include/hardware/audio_amplifier.h | 142 | ||||
-rw-r--r-- | include/hardware/gralloc.h | 17 | ||||
-rw-r--r-- | include/hardware/lights.h | 6 | ||||
-rw-r--r-- | include/hardware/nfc.h | 1 | ||||
-rw-r--r-- | include/hardware/power.h | 14 |
5 files changed, 179 insertions, 1 deletions
diff --git a/include/hardware/audio_amplifier.h b/include/hardware/audio_amplifier.h new file mode 100644 index 0000000..4305094 --- /dev/null +++ b/include/hardware/audio_amplifier.h @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2015, The CyanogenMod Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CM_AUDIO_AMPLIFIER_INTERFACE_H +#define CM_AUDIO_AMPLIFIER_INTERFACE_H + +#include <stdint.h> +#include <sys/cdefs.h> +#include <sys/types.h> + +#include <hardware/audio.h> +#include <hardware/hardware.h> + +#include <system/audio.h> + +__BEGIN_DECLS + +#define AMPLIFIER_HARDWARE_MODULE_ID "audio_amplifier" + +#define AMPLIFIER_HARDWARE_INTERFACE "audio_amplifier_hw_if" + +#define AMPLIFIER_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) + +#define AMPLIFIER_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) +#define AMPLIFIER_DEVICE_API_VERSION_2_0 HARDWARE_DEVICE_API_VERSION(2, 0) +#define AMPLIFIER_DEVICE_API_VERSION_CURRENT AMPLIFIER_DEVICE_API_VERSION_2_0 + +typedef struct amplifier_device { + /** + * Common methods of the amplifier device. This *must* be the first member + * of amplifier_device as users of this structure will cast a hw_device_t + * to amplifier_device pointer in contexts where it's known + * the hw_device_t references a amplifier_device. + */ + struct hw_device_t common; + + /** + * Notify amplifier device of current input devices + * + * This function should handle only input devices. + */ + int (*set_input_devices)(struct amplifier_device *device, uint32_t devices); + + /** + * Notify amplifier device of current output devices + * + * This function should handle only output devices. + */ + int (*set_output_devices)(struct amplifier_device *device, uint32_t devices); + + /** + * Notify amplifier device of output device enable/disable + * + * This function should handle only output devices. + */ + int (*enable_output_devices)(struct amplifier_device *device, + uint32_t devices, bool enable); + + /** + * Notify amplifier device of input device enable/disable + * + * This function should handle only input devices. + */ + int (*enable_input_devices)(struct amplifier_device *device, + uint32_t devices, bool enable); + + /** + * Notify amplifier device about current audio mode + */ + int (*set_mode)(struct amplifier_device *device, audio_mode_t mode); + + /** + * Notify amplifier device that an output stream has started + */ + int (*output_stream_start)(struct amplifier_device *device, + struct audio_stream_out *stream, bool offload); + + /** + * Notify amplifier device that an input stream has started + */ + int (*input_stream_start)(struct amplifier_device *device, + struct audio_stream_in *stream); + + /** + * Notify amplifier device that an output stream has stopped + */ + int (*output_stream_standby)(struct amplifier_device *device, + struct audio_stream_out *stream); + + /** + * Notify amplifier device that an input stream has stopped + */ + int (*input_stream_standby)(struct amplifier_device *device, + struct audio_stream_in *stream); + + /** + * set/get output audio device parameters. + */ + int (*set_parameters)(struct amplifier_device *device, + struct str_parms *parms); +} amplifier_device_t; + +typedef struct amplifier_module { + /** + * Common methods of the amplifier module. This *must* be the first member + * of amplifier_module as users of this structure will cast a hw_module_t + * to amplifier_module pointer in contexts where it's known + * the hw_module_t references a amplifier_module. + */ + struct hw_module_t common; +} amplifier_module_t; + +/** convenience API for opening and closing a supported device */ + +static inline int amplifier_device_open(const struct hw_module_t *module, + struct amplifier_device **device) +{ + return module->methods->open(module, AMPLIFIER_HARDWARE_INTERFACE, + (struct hw_device_t **) device); +} + +static inline int amplifier_device_close(struct amplifier_device *device) +{ + return device->common.close(&device->common); +} + +__END_DECLS + +#endif // CM_AUDIO_AMPLIFIER_INTERFACE_H diff --git a/include/hardware/gralloc.h b/include/hardware/gralloc.h index ef86f90..07ac029 100644 --- a/include/hardware/gralloc.h +++ b/include/hardware/gralloc.h @@ -143,6 +143,19 @@ enum { GRALLOC_USAGE_PRIVATE_2 = 0x40000000, GRALLOC_USAGE_PRIVATE_3 = 0x80000000, GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000, + +#ifdef EXYNOS4_ENHANCEMENTS + /* SAMSUNG */ + GRALLOC_USAGE_PRIVATE_NONECACHE = 0x00800000, + + GRALLOC_USAGE_HW_FIMC1 = 0x01000000, + GRALLOC_USAGE_HW_ION = 0x02000000, + GRALLOC_USAGE_YUV_ADDR = 0x04000000, + GRALLOC_USAGE_CAMERA = 0x08000000, + + /* SEC Private usage , for Overlay path at HWC */ + GRALLOC_USAGE_HWC_HWOVERLAY = 0x20000000, +#endif }; /*****************************************************************************/ @@ -237,6 +250,10 @@ typedef struct gralloc_module_t { int (*unlock)(struct gralloc_module_t const* module, buffer_handle_t handle); +#ifdef EXYNOS4_ENHANCEMENTS + int (*getphys) (struct gralloc_module_t const* module, + buffer_handle_t handle, void** paddr); +#endif /* reserved for future use */ int (*perform)(struct gralloc_module_t const* module, diff --git a/include/hardware/lights.h b/include/hardware/lights.h index 2cf5519..fccd242 100644 --- a/include/hardware/lights.h +++ b/include/hardware/lights.h @@ -51,6 +51,12 @@ __BEGIN_DECLS #define LIGHT_ID_BLUETOOTH "bluetooth" #define LIGHT_ID_WIFI "wifi" +/* + * Additional hardware-specific lights + */ +#define LIGHT_ID_CAPS "caps" +#define LIGHT_ID_FUNC "func" + /* ************************************************************************ * Flash modes for the flashMode field of light_state_t. */ diff --git a/include/hardware/nfc.h b/include/hardware/nfc.h index 58d33d9..6002e34 100644 --- a/include/hardware/nfc.h +++ b/include/hardware/nfc.h @@ -54,6 +54,7 @@ __BEGIN_DECLS */ #define NFC_NCI_HARDWARE_MODULE_ID "nfc_nci" #define NFC_NCI_BCM2079X_HARDWARE_MODULE_ID "nfc_nci.bcm2079x" +#define NFC_NCI_NXP_PN54X_HARDWARE_MODULE_ID "nfc_nci.pn54x" #define NFC_NCI_CONTROLLER "nci" /* diff --git a/include/hardware/power.h b/include/hardware/power.h index af7799e..c0fcba1 100644 --- a/include/hardware/power.h +++ b/include/hardware/power.h @@ -46,7 +46,13 @@ typedef enum { */ POWER_HINT_VIDEO_ENCODE = 0x00000003, POWER_HINT_VIDEO_DECODE = 0x00000004, - POWER_HINT_LOW_POWER = 0x00000005 + POWER_HINT_LOW_POWER = 0x00000005, + + POWER_HINT_CPU_BOOST = 0x00000010, + POWER_HINT_LAUNCH_BOOST = 0x00000011, + POWER_HINT_AUDIO = 0x00000020, + POWER_HINT_SET_PROFILE = 0x00000030 + } power_hint_t; typedef enum { @@ -125,6 +131,12 @@ typedef struct power_module { * parameter is non-zero when low power mode is activated, and zero * when deactivated. * + * POWER_HINT_CPU_BOOST + * + * An operation is happening where it would be ideal for the CPU to + * be boosted for a specific duration. The data parameter is an + * integer value of the boost duration in microseconds. + * * A particular platform may choose to ignore any hint. * * availability: version 0.2 |