Skip to content

Commit

Permalink
new AO CEC adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
gdachs authored and opdenkamp committed Oct 26, 2016
1 parent 07cbc7e commit d03dd79
Show file tree
Hide file tree
Showing 12 changed files with 644 additions and 3 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Follow the instructions in [docs/README.linux.md](docs/README.linux.md) and pass
cmake -DHAVE_EXYNOS_API=1 ..
```

### AOCEC
To compile in support for AOCEC devices, you have to pass the argument -DHAVE_AOCEC_API=1 to cmake:
```
cmake -DHAVE_AOCEC_API=1 ..
```

### TDA995x
Follow the instructions in [docs/README.linux.md](docs/README.linux.md) and pass the argument -DHAVE_TDA995X_API=1 to cmake:
```
Expand Down
13 changes: 12 additions & 1 deletion include/cectypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,16 @@ namespace CEC {
*/
#define CEC_MAX_DATA_PACKET_SIZE (16 * 4)

/*!
* the path to use for the AOCEC HDMI CEC device
*/
#define CEC_AOCEC_PATH "/dev/aocec"

/*!
* the name of the virtual COM port to use for the AOCEC' CEC wire
*/
#define CEC_AOCEC_VIRTUAL_COM "AOCEC"

/*!
* Mimimum client version
*/
Expand Down Expand Up @@ -850,7 +860,8 @@ typedef enum cec_adapter_type
ADAPTERTYPE_P8_DAUGHTERBOARD = 0x2,
ADAPTERTYPE_RPI = 0x100,
ADAPTERTYPE_TDA995x = 0x200,
ADAPTERTYPE_EXYNOS = 0x300
ADAPTERTYPE_EXYNOS = 0x300,
ADAPTERTYPE_AOCEC = 0x500
} cec_adapter_type;

/** force exporting through swig */
Expand Down
3 changes: 3 additions & 0 deletions src/libcec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ set(CEC_HEADERS devices/CECRecordingDevice.h
adapter/Exynos/ExynosCEC.h
adapter/Exynos/ExynosCECAdapterDetection.h
adapter/Exynos/ExynosCECAdapterCommunication.h
adapter/AOCEC/AOCEC.h
adapter/AOCEC/AOCECAdapterDetection.h
adapter/AOCEC/AOCECAdapterCommunication.h
adapter/Pulse-Eight/USBCECAdapterMessageQueue.h
adapter/Pulse-Eight/USBCECAdapterCommunication.h
adapter/Pulse-Eight/USBCECAdapterCommands.h
Expand Down
55 changes: 55 additions & 0 deletions src/libcec/adapter/AOCEC/AOCEC.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#pragma once
/*
* This file is part of the libCEC(R) library.
*
* libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs
* based heavily on:
* libCEC Exynos Code Copyright (C) 2014 Valentin Manea
* libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
* libCEC(R) is an original work, containing original code.
*
* libCEC(R) is a trademark of Pulse-Eight Limited.
*
* This program is dual-licensed; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
* Alternatively, you can license this library under a commercial license,
* please contact Pulse-Eight Licensing for more information.
*
* For more information contact:
* Pulse-Eight Licensing <license@pulse-eight.com>
* http://www.pulse-eight.com/
* http://www.pulse-eight.net/
*/


#define CEC_DEFAULT_PADDR 0x1000

#define CEC_IOC_MAGIC 'C'
#define CEC_IOC_GET_PHYSICAL_ADDR _IOR(CEC_IOC_MAGIC, 0x00, uint16_t)
#define CEC_IOC_GET_VERSION _IOR(CEC_IOC_MAGIC, 0x01, int)
#define CEC_IOC_GET_VENDOR_ID _IOR(CEC_IOC_MAGIC, 0x02, uint32_t)
#define CEC_IOC_GET_PORT_INFO _IOR(CEC_IOC_MAGIC, 0x03, int)
#define CEC_IOC_GET_PORT_NUM _IOR(CEC_IOC_MAGIC, 0x04, int)
#define CEC_IOC_GET_SEND_FAIL_REASON _IOR(CEC_IOC_MAGIC, 0x05, uint32_t)
#define CEC_IOC_SET_OPTION_WAKEUP _IOW(CEC_IOC_MAGIC, 0x06, uint32_t)
#define CEC_IOC_SET_OPTION_ENALBE_CEC _IOW(CEC_IOC_MAGIC, 0x07, uint32_t)
#define CEC_IOC_SET_OPTION_SYS_CTRL _IOW(CEC_IOC_MAGIC, 0x08, uint32_t)
#define CEC_IOC_SET_OPTION_SET_LANG _IOW(CEC_IOC_MAGIC, 0x09, uint32_t)
#define CEC_IOC_GET_CONNECT_STATUS _IOR(CEC_IOC_MAGIC, 0x0A, uint32_t)
#define CEC_IOC_ADD_LOGICAL_ADDR _IOW(CEC_IOC_MAGIC, 0x0B, uint32_t)
#define CEC_IOC_CLR_LOGICAL_ADDR _IOW(CEC_IOC_MAGIC, 0x0C, uint32_t)

#define CEC_MAX_FRAME_SIZE 16
Loading

0 comments on commit d03dd79

Please sign in to comment.