CEC_HDMI_PORT variable support for exynos hardware.
[deb_libcec.git] / debian / patches / 0001_libcec_add-exynos-cec-variable.patch
1 diff -Nur a/src/lib/adapter/Exynos/ExynosCECAdapterCommunication.cpp b/src/lib/adapter/Exynos/ExynosCECAdapterCommunication.cpp
2 --- a/src/lib/adapter/Exynos/ExynosCECAdapterCommunication.cpp 2014-10-28 15:20:50.000000000 +0000
3 +++ b/src/lib/adapter/Exynos/ExynosCECAdapterCommunication.cpp 2015-01-25 23:42:05.324537990 +0000
4 @@ -161,16 +161,14 @@
5
6 uint16_t CExynosCECAdapterCommunication::GetPhysicalAddress(void)
7 {
8 - uint16_t phys_addr = CEC_DEFAULT_PADDR;
9 + char* addr_string = getenv("CEC_HDMI_PORT");
10 + if (addr_string == NULL)
11 + return CEC_DEFAULT_PHYSICAL_ADDRESS;
12 + int addr_int = atoi(addr_string);
13 + if (addr_int == 0)
14 + return CEC_DEFAULT_PHYSICAL_ADDRESS;
15
16 - FILE *f = fopen(CEC_PADDR_NAME, "r");
17 - if(f) {
18 - if(fscanf(f, "%hu", &phys_addr) != 1)
19 - phys_addr = CEC_DEFAULT_PADDR;
20 -
21 - fclose(f);
22 - }
23 - return phys_addr;
24 + return 0x1000 * addr_int;
25 }
26
27