diff options
author | Naseer Ahmed <naseer@codeaurora.org> | 2014-07-23 17:56:26 -0400 |
---|---|---|
committer | Naseer Ahmed <naseer@codeaurora.org> | 2015-03-02 14:54:49 -0500 |
commit | 7a7b66d1f03997b19ddc0b630dc36850c7826d97 (patch) | |
tree | 721f17316cc829a8009368ca5dc465c135a52a3c /hdmi_cec/qhdmi_cec.h | |
parent | 361b88f0c31d90b1966bc7371c2aee3e089185cb (diff) | |
download | display-7a7b66d1f03997b19ddc0b630dc36850c7826d97.tar.gz |
display: Add HDMI CEC HAL
Implement the spec as per
hardware/libhardware/include/hardware/hdmi_cec.h
Change-Id: I02e1ba9deee1007b7e5922c363b9f5d6c6ad82a9
Diffstat (limited to 'hdmi_cec/qhdmi_cec.h')
-rw-r--r-- | hdmi_cec/qhdmi_cec.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/hdmi_cec/qhdmi_cec.h b/hdmi_cec/qhdmi_cec.h new file mode 100644 index 00000000..4afd07fb --- /dev/null +++ b/hdmi_cec/qhdmi_cec.h @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2014 The Linux Foundation. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above +* copyright notice, this list of conditions and the following +* disclaimer in the documentation and/or other materials provided +* with the distribution. +* * Neither the name of The Linux Foundation. nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#ifndef QHDMI_CEC_H +#define QHDMI_CEC_H + +#include <hardware/hdmi_cec.h> +#include <utils/RefBase.h> + +namespace qClient { + class QHDMIClient; +}; + +namespace qhdmicec { + +#define SYSFS_BASE "/sys/class/graphics/fb" +#define MAX_PATH_LENGTH 128 + +struct cec_callback_t { + // Function in HDMI service to call back on CEC messages + event_callback_t callback_func; + // This stores the object to pass back to the framework + void* callback_arg; + +}; + +struct cec_context_t { + hdmi_cec_device_t device; // Device for HW module + cec_callback_t callback; // Struct storing callback object + bool enabled; + bool arc_enabled; + int fb_num; // Framebuffer node for HDMI + char fb_sysfs_path[MAX_PATH_LENGTH]; + hdmi_port_info *port_info; // HDMI port info + + // Logical address is stored in an array, the index of the array is the + // logical address and the value in the index shows whether it is set or not + int logical_address[CEC_ADDR_BROADCAST]; + int version; + uint32_t vendor_id; + android::sp<qClient::QHDMIClient> disp_client; +}; + +void cec_receive_message(cec_context_t *ctx, char *msg, ssize_t len); +void cec_hdmi_hotplug(cec_context_t *ctx, int connected); + +}; //namespace +#endif /* end of include guard: QHDMI_CEC_H */ |