From 824e5d18aa2bf309302da1102ebf5eac6fed470a Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Mon, 19 Sep 2016 21:52:29 +0200 Subject: [PATCH 1/7] u-boot: update to hardkernel-6e4e886 This adds support for setting max_freq and maxcpus bootargs Also adds a patch for missing CEC wake-up code --- packages/tools/u-boot/package.mk | 2 +- ...0001-use-arm-eabi-for-bl301-scp_task.patch | 0 projects/Odroid_C2/bootloader/boot.ini | 31 +- .../linux/linux-008-max_freq_dvfs_table.patch | 97 ++ .../u-boot-0002-fix-power-off-wakeup.patch | 1468 ----------------- .../u-boot-0002-update_cec_wakeup_code.patch | 225 +++ 6 files changed, 353 insertions(+), 1470 deletions(-) rename packages/tools/u-boot/patches/{61f29bb => 6e4e886}/u-boot-0001-use-arm-eabi-for-bl301-scp_task.patch (100%) create mode 100644 projects/Odroid_C2/patches/linux/linux-008-max_freq_dvfs_table.patch delete mode 100644 projects/Odroid_C2/patches/u-boot/u-boot-0002-fix-power-off-wakeup.patch create mode 100644 projects/Odroid_C2/patches/u-boot/u-boot-0002-update_cec_wakeup_code.patch diff --git a/packages/tools/u-boot/package.mk b/packages/tools/u-boot/package.mk index e27b317096..784e8eb324 100644 --- a/packages/tools/u-boot/package.mk +++ b/packages/tools/u-boot/package.mk @@ -25,7 +25,7 @@ if [ "$UBOOT_VERSION" = "imx6-cuboxi" ]; then PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz" [ -n "$UBOOT_CONFIG_V2" ] && PKG_DEPENDS_TARGET="toolchain u-boot-v2" elif [ "$UBOOT_VERSION" = "hardkernel" ]; then - PKG_VERSION="61f29bb" + PKG_VERSION="6e4e886" PKG_SITE="https://github.com/hardkernel/u-boot" PKG_URL="https://github.com/hardkernel/u-boot/archive/$PKG_VERSION.tar.gz" PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET gcc-linaro-aarch64-elf:host gcc-linaro-arm-eabi:host" diff --git a/packages/tools/u-boot/patches/61f29bb/u-boot-0001-use-arm-eabi-for-bl301-scp_task.patch b/packages/tools/u-boot/patches/6e4e886/u-boot-0001-use-arm-eabi-for-bl301-scp_task.patch similarity index 100% rename from packages/tools/u-boot/patches/61f29bb/u-boot-0001-use-arm-eabi-for-bl301-scp_task.patch rename to packages/tools/u-boot/patches/6e4e886/u-boot-0001-use-arm-eabi-for-bl301-scp_task.patch diff --git a/projects/Odroid_C2/bootloader/boot.ini b/projects/Odroid_C2/bootloader/boot.ini index e1df57a56a..1d5516845b 100644 --- a/projects/Odroid_C2/bootloader/boot.ini +++ b/projects/Odroid_C2/bootloader/boot.ini @@ -136,13 +136,42 @@ setenv hdmi_cec "1" #------------------------------------------------------------------------------------------------------ setenv audio_dac "0" +#------------------------------------------------------------------------------------------------------ +# +# CPU Frequency / Cores control +# +# WARNING!!! WARNING!!! WARNING!!! +# Before changing anything here please read the wiki entry: +# http://odroid.com/dokuwiki/doku.php?id=en:c2_set_cpu_freq +# +# MAX CPU's +# setenv maxcpus "1" +# setenv maxcpus "2" +# setenv maxcpus "3" +# setenv maxcpus "4" +# +# MAX Frequency +# setenv max_freq "2016" # 2.016GHz +# setenv max_freq "1944" # 1.944GHz +# setenv max_freq "1944" # 1.944GHz +# setenv max_freq "1920" # 1.920GHz +# setenv max_freq "1896" # 1.896GHz +# setenv max_freq "1752" # 1.752GHz +# setenv max_freq "1680" # 1.680GHz +# setenv max_freq "1656" # 1.656GHz +# setenv max_freq "1536" # 1.536GHz +# +#------------------------------------------------------------------------------------------------------ +setenv maxcpus "4" +setenv max_freq "1536" + #------------------------------------------------------------------------------------------------------ # # Odroid C1 specific # #------------------------------------------------------------------------------------------------------ setenv odroidp1 "no_console_suspend hdmimode=${video_output} m_bpp=${video_bpp} vout=${video_mode}" -setenv odroidp2 "${disableuhs} consoleblank=0" +setenv odroidp2 "${disableuhs} consoleblank=0 max_freq=${max_freq} maxcpus=${maxcpus}" setenv odroid "${odroidp1} ${odroidp2}" #------------------------------------------------------------------------------------------------------ diff --git a/projects/Odroid_C2/patches/linux/linux-008-max_freq_dvfs_table.patch b/projects/Odroid_C2/patches/linux/linux-008-max_freq_dvfs_table.patch new file mode 100644 index 0000000000..c961848a26 --- /dev/null +++ b/projects/Odroid_C2/patches/linux/linux-008-max_freq_dvfs_table.patch @@ -0,0 +1,97 @@ +From dee146cbbb8428b073fba85390577590fc365d86 Mon Sep 17 00:00:00 2001 +From: Joy Cho +Date: Wed, 31 Aug 2016 16:27:48 +0900 +Subject: [PATCH] ODROID-C2: Add setup routine to set max. cpu frequency of + dvfs table + +- set "max_freq" in boot.ini +- in MHz unit +ex) setenv max_freq "1656" + +Change-Id: I352c9540d0c34d3ec0ba0f470dae9d4e0786c001 +--- + drivers/amlogic/mailbox/scpi_protocol.c | 53 +++++++++++++++++++++++++++++++++ + 1 file changed, 53 insertions(+) + +diff --git a/drivers/amlogic/mailbox/scpi_protocol.c b/drivers/amlogic/mailbox/scpi_protocol.c +index ec787d2..f3aa3e0 100644 +--- a/drivers/amlogic/mailbox/scpi_protocol.c ++++ b/drivers/amlogic/mailbox/scpi_protocol.c +@@ -129,6 +129,12 @@ static int high_priority_cmds[] = { + SCPI_CMD_SENSOR_CFG_BOUNDS, + }; + ++#if defined(CONFIG_ARCH_MESON64_ODROIDC2) ++#define DVFS_COUNT_MAX 13 ++#define DVFS_COUNT_1536 6 ++static unsigned long max_freq_dvfs; ++#endif ++ + static struct scpi_opp *scpi_opps[MAX_DVFS_DOMAINS]; + + static int scpi_linux_errmap[SCPI_ERR_MAX] = { +@@ -267,6 +273,9 @@ struct scpi_opp *scpi_dvfs_get_opps(u8 domain) + struct scpi_opp *opps; + size_t opps_sz; + int count, ret; ++#if defined(CONFIG_ARCH_MESON64_ODROIDC2) ++ int i, max_index; ++#endif + + if (domain >= MAX_DVFS_DOMAINS) + return ERR_PTR(-EINVAL); +@@ -285,6 +294,27 @@ struct scpi_opp *scpi_dvfs_get_opps(u8 domain) + return ERR_PTR(-ENOMEM); + + count = DVFS_OPP_COUNT(buf.header); ++ ++#if defined(CONFIG_ARCH_MESON64_ODROIDC2) ++ max_index = 0; ++ if (max_freq_dvfs) { ++ for (i = 0; i < count; i++) { ++ if (buf.opp[i].freq_hz == max_freq_dvfs) ++ break; ++ else ++ max_index++; ++ } ++ count = max_index + 1; ++ } ++ /* if no param "max_freq_dvfs or wrong "max_freq_dvfs" ++ * from boot.ini, consider stable max value */ ++ if ((max_freq_dvfs == 0) || (count > DVFS_COUNT_MAX)) ++ count = DVFS_COUNT_1536; /* default max : 1.536GHz */ ++ ++ pr_info("dvfs [%s] - new count %d, max_freq %ld\n", __func__, ++ count, max_freq_dvfs); ++#endif ++ + opps_sz = count * sizeof(*(opps->opp)); + + opps->count = count; +@@ -416,3 +446,26 @@ int scpi_get_sensor_value(u16 sensor, u32 *val) + return ret; + } + EXPORT_SYMBOL_GPL(scpi_get_sensor_value); ++ ++#if defined(CONFIG_ARCH_MESON64_ODROIDC2) ++static int __init get_max_freq(char *str) ++{ ++ int ret; ++ ++ if (NULL == str) { ++ /* consider default set */ ++ max_freq_dvfs = 1536000000; ++ return -EINVAL; ++ } ++ ++ ret = kstrtoul(str, 0, &max_freq_dvfs); ++ ++ /* in unit Hz */ ++ max_freq_dvfs *= 1000000; ++ ++ pr_info("dvfs [%s] - max_freq : %ld\n", __func__, max_freq_dvfs); ++ ++ return 0; ++} ++__setup("max_freq=", get_max_freq); ++#endif diff --git a/projects/Odroid_C2/patches/u-boot/u-boot-0002-fix-power-off-wakeup.patch b/projects/Odroid_C2/patches/u-boot/u-boot-0002-fix-power-off-wakeup.patch deleted file mode 100644 index 67ad437a48..0000000000 --- a/projects/Odroid_C2/patches/u-boot/u-boot-0002-fix-power-off-wakeup.patch +++ /dev/null @@ -1,1468 +0,0 @@ -From 6e05bb98a2f4b4c45ad0e77eeb014f366ecac3b5 Mon Sep 17 00:00:00 2001 -From: Jonas Karlman -Date: Sat, 13 Aug 2016 17:23:22 +0200 -Subject: [PATCH 1/6] Fix secure_task loop - ---- - arch/arm/cpu/armv8/gxb/firmware/scp_task/misc.S | 4 ++-- - arch/arm/cpu/armv8/gxb/firmware/scp_task/user_task.c | 7 +------ - 2 files changed, 3 insertions(+), 8 deletions(-) - -diff --git a/arch/arm/cpu/armv8/gxb/firmware/scp_task/misc.S b/arch/arm/cpu/armv8/gxb/firmware/scp_task/misc.S -index 4ce73f2..9b97da3 100644 ---- a/arch/arm/cpu/armv8/gxb/firmware/scp_task/misc.S -+++ b/arch/arm/cpu/armv8/gxb/firmware/scp_task/misc.S -@@ -19,6 +19,6 @@ bss_loop: - - .align 2 - _bss_start: --.long _bss_start -+.long _bssstart - _bss_end: --.long _bss_end -\ No newline at end of file -+.long _bssend -\ No newline at end of file -diff --git a/arch/arm/cpu/armv8/gxb/firmware/scp_task/user_task.c b/arch/arm/cpu/armv8/gxb/firmware/scp_task/user_task.c -index 53a35c4..b2f6394 100644 ---- a/arch/arm/cpu/armv8/gxb/firmware/scp_task/user_task.c -+++ b/arch/arm/cpu/armv8/gxb/firmware/scp_task/user_task.c -@@ -64,13 +64,8 @@ void secure_task(void) - presume = (struct resume_param *)(response+1); - presume->method = resume_data.method; - } -- -- /* FIXME : __switch_back_highmb() ? */ -- while(1) -- ; - } -- -- __switch_back_highmb(); -+ __switch_back_securemb(); - } - } - - -From e18fc08f3e9675dd6e418fd938bcf05e9d8d287d Mon Sep 17 00:00:00 2001 -From: Jonas Karlman -Date: Sat, 13 Aug 2016 17:23:22 +0200 -Subject: [PATCH 2/6] Use power_off/on_at_24M to turn off/on blue led - ---- - board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c b/board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c -index 65633b4..374481a 100644 ---- a/board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c -+++ b/board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c -@@ -96,15 +96,16 @@ static void power_on_at_clk81(void) - power_on_3v3(); - } - -+/*odroidc2 GPIOAO_13 powr on :0, power_off :1*/ - static void power_off_at_24M(void) - { - //LED gpioao_13 -- aml_update_bits(AO_GPIO_O_EN_N, 1<<29, 0); -+ aml_update_bits(AO_GPIO_O_EN_N, 1<<29, 1<<29); - } - - static void power_on_at_24M(void) - { -- aml_update_bits(AO_GPIO_O_EN_N, 1<<29, 1<<29); -+ aml_update_bits(AO_GPIO_O_EN_N, 1<<29, 0); - } - - static void power_off_at_32k(void) -@@ -201,7 +202,7 @@ void set_GPIOAO_BIT13(void) - - void set_custom_gpio_status(void) - { -- set_GPIOAO_BIT13(); -+ //set_GPIOAO_BIT13(); - set_GPIOX_BIT11(); - set_GPIOX_BIT19(); - set_GPIOY_BIT14(); - -From 03115f43534f9d29f952c557d3846028c4ecdf7c Mon Sep 17 00:00:00 2001 -From: Jonas Karlman -Date: Sat, 13 Aug 2016 17:23:22 +0200 -Subject: [PATCH 3/6] Fix power off/on vcck - -GPIOAO.BIT2 is used for VCCK_CON according to odroid-c2_rev0.2_20160226.pdf - -Also disables power off/on 3v3 ---- - board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) - -diff --git a/board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c b/board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c -index 374481a..c4d15b8 100644 ---- a/board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c -+++ b/board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c -@@ -62,25 +62,25 @@ void pwm_set_voltage(unsigned int id, unsigned int voltage) - - static void power_off_3v3(void) - { -- aml_update_bits(AO_GPIO_O_EN_N, 1<<2, 0); -- aml_update_bits(AO_GPIO_O_EN_N, 1<<18, 1<<18); -+ //aml_update_bits(AO_GPIO_O_EN_N, 1<<2, 0); -+ //aml_update_bits(AO_GPIO_O_EN_N, 1<<18, 1<<18); - } - static void power_on_3v3(void) - { -- aml_update_bits(AO_GPIO_O_EN_N, 1<<2, 0); -- aml_update_bits(AO_GPIO_O_EN_N, 1<<18, 0); -+ //aml_update_bits(AO_GPIO_O_EN_N, 1<<2, 0); -+ //aml_update_bits(AO_GPIO_O_EN_N, 1<<18, 0); - } - --/*p200/201 GPIOAO_4 powr on :1, power_off :0*/ -+/*odroidc2 GPIOAO_2 powr on :1, power_off :0*/ - static void power_off_vcck(void) - { -- aml_update_bits(AO_GPIO_O_EN_N, 1<<4, 0); -- aml_update_bits(AO_GPIO_O_EN_N, 1<<20, 0); -+ aml_update_bits(AO_GPIO_O_EN_N, 1<<2, 0); -+ aml_update_bits(AO_GPIO_O_EN_N, 1<<18, 0); - } - static void power_on_vcck(void) - { -- aml_update_bits(AO_GPIO_O_EN_N, 1<<4, 0); -- aml_update_bits(AO_GPIO_O_EN_N, 1<<20, 1<<20); -+ aml_update_bits(AO_GPIO_O_EN_N, 1<<2, 0); -+ aml_update_bits(AO_GPIO_O_EN_N, 1<<18, 1<<18); - } - - static void power_off_at_clk81(void) - -From 96d7386d8270a8684c3a651fdc20dbc1c2b58226 Mon Sep 17 00:00:00 2001 -From: Jonas Karlman -Date: Sat, 13 Aug 2016 17:23:22 +0200 -Subject: [PATCH 4/6] Disable power-key wakeup - -GPIOAO.BIT3 is used for TF_3V3N_1V8_EN according to odroid-c2_rev0.2_20160226.pdf ---- - board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c b/board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c -index c4d15b8..f6f2a7d 100644 ---- a/board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c -+++ b/board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c -@@ -249,10 +249,12 @@ unsigned int detect_key(unsigned int suspend_from) - cec_node_init(); - } - #endif -+#if 0 - if ((readl(AO_GPIO_I) & (1<<3)) == 0) { - exit_reason = POWER_KEY_WAKEUP; - break; - } -+#endif - if (time_out != 0) { - if ((get_time() - init_time) >= time_out * 1000 * 1000) { - exit_reason = AUTO_WAKEUP; - -From 57c021cfc6504569aa66d26dc3cd17b97155eddb Mon Sep 17 00:00:00 2001 -From: Jonas Karlman -Date: Sat, 13 Aug 2016 17:23:22 +0200 -Subject: [PATCH 5/6] Backport remote-power-key wakeup code - ---- - .../cpu/armv8/gxb/firmware/scp_task/scp_remote.c | 93 ++++++++++++++++++++-- - 1 file changed, 88 insertions(+), 5 deletions(-) - -diff --git a/arch/arm/cpu/armv8/gxb/firmware/scp_task/scp_remote.c b/arch/arm/cpu/armv8/gxb/firmware/scp_task/scp_remote.c -index e73d172..e3cabb7 100644 ---- a/arch/arm/cpu/armv8/gxb/firmware/scp_task/scp_remote.c -+++ b/arch/arm/cpu/armv8/gxb/firmware/scp_task/scp_remote.c -@@ -18,22 +18,105 @@ enum{ - DECODEMODE_MAX - }; - -+typedef struct reg_remote { -+ int reg; -+ unsigned int val; -+} reg_remote; -+#define CONFIG_END 0xffffffff - #define IR_POWER_KEY_MASK 0xffffffff -+#if 0 -+//32K -+static const reg_remote RDECODEMODE_NEC[] = { -+ {AO_MF_IR_DEC_LDR_ACTIVE, 350 << 16 | 260 << 0}, -+ {AO_MF_IR_DEC_LDR_IDLE, 200 << 16 | 120 << 0}, -+ {AO_MF_IR_DEC_LDR_REPEAT, 100 << 16 | 70 << 0}, -+ {AO_MF_IR_DEC_BIT_0, 50 << 16 | 20 << 0}, -+ {AO_MF_IR_DEC_REG0, 3 << 28 | (0xFA0 << 12)}, -+ {AO_MF_IR_DEC_STATUS, (100 << 20) | (45 << 10)}, -+ {AO_MF_IR_DEC_REG1, 0x600fdf00}, -+ {AO_MF_IR_DEC_REG2, 0x0}, -+ {AO_MF_IR_DEC_DURATN2, 0}, -+ {AO_MF_IR_DEC_DURATN3, 0}, -+ {CONFIG_END, 0} -+}; -+#else -+//24M -+static const reg_remote RDECODEMODE_NEC[] = { -+ {AO_MF_IR_DEC_LDR_ACTIVE, 477 << 16 | 400 << 0}, -+ {AO_MF_IR_DEC_LDR_IDLE, 248 << 16 | 202 << 0}, -+ {AO_MF_IR_DEC_LDR_REPEAT, 130 << 16 | 110 << 0}, -+ {AO_MF_IR_DEC_BIT_0, 60 << 16 | 48 << 0}, -+ {AO_MF_IR_DEC_REG0, 3 << 28 | (0xFA0 << 12) | 0x13}, -+ {AO_MF_IR_DEC_STATUS, (111 << 20) | (100 << 10)}, -+ {AO_MF_IR_DEC_REG1, 0x9f50}, -+ {AO_MF_IR_DEC_REG2, 0x0}, -+ {AO_MF_IR_DEC_DURATN2, 0}, -+ {AO_MF_IR_DEC_DURATN3, 0}, -+ {CONFIG_END, 0} -+}; -+#endif -+ -+static const reg_remote *remoteregsTab[] = { -+ RDECODEMODE_NEC, -+}; -+ -+void setremotereg(const reg_remote * r) -+{ -+ writel(r->val, r->reg); -+} -+ -+int set_remote_mode(int mode) -+{ -+ const reg_remote *reg; -+ reg = remoteregsTab[mode]; -+ while (CONFIG_END != reg->reg) -+ setremotereg(reg++); -+ return 0; -+} -+ -+/***************************************************************** -+** -+** func : ir_remote_init -+** in this function will do pin configuration and and initialize for -+** IR Remote hardware decoder mode at 32kHZ on ARC. -+** -+********************************************************************/ -+static int ir_remote_init_32k_mode(void) -+{ -+ //volatile unsigned int status,data_value; -+ int val = readl(AO_RTI_PIN_MUX_REG); -+ writel((val | (1 << 0)), AO_RTI_PIN_MUX_REG); -+ set_remote_mode(DECODEMODE_NEC); -+ //status = readl(AO_MF_IR_DEC_STATUS); -+ uart_put_hex(readl(AO_MF_IR_DEC_STATUS), 32); -+ //data_value = readl(AO_MF_IR_DEC_FRAME); -+ uart_put_hex(readl(AO_MF_IR_DEC_FRAME), 32); -+ -+ //step 2 : request nec_remote irq & enable it -+ return 0; -+} -+ -+void init_custom_trigger(void) -+{ -+ ir_remote_init_32k_mode(); -+} -+ - static unsigned int kk[] = { -- 0xe51afb04, -+ 0x23dc4db2, - }; - static int init_remote(void) - { -- uart_put_hex(readl(AO_IR_DEC_STATUS), 32); -- uart_put_hex(readl(AO_IR_DEC_FRAME), 32); -+ //uart_put_hex(readl(AO_IR_DEC_STATUS), 32); -+ //uart_put_hex(readl(AO_IR_DEC_FRAME), 32); -+ init_custom_trigger(); - return 0; - } - - static int remote_detect_key(void) - { - unsigned power_key; -- if (((readl(AO_IR_DEC_STATUS))>>3) & 0x1) { -- power_key = readl(AO_IR_DEC_FRAME); -+ if (((readl(AO_MF_IR_DEC_STATUS))>>3) & 0x1) { -+ power_key = readl(AO_MF_IR_DEC_FRAME); - if ((power_key&IR_POWER_KEY_MASK) == kk[DECODEMODE_NEC]) - return 1; - - -From 005dc1f22f3d3097dbabc6d25cc6e3b54741671b Mon Sep 17 00:00:00 2001 -From: Jonas Karlman -Date: Wed, 24 Aug 2016 20:04:36 +0200 -Subject: [PATCH 6/6] Fix CEC wakeup - ---- - .../cpu/armv8/gxb/firmware/scp_task/cec_tx_reg.h | 33 +- - .../cpu/armv8/gxb/firmware/scp_task/hdmi_cec_arc.c | 840 ++++++++------------- - arch/arm/cpu/armv8/gxb/firmware/scp_task/suspend.c | 8 +- - .../cpu/armv8/gxb/firmware/scp_task/task_apis.h | 4 +- - .../odroidc2/firmware/scp_task/pwr_ctrl.c | 16 +- - 5 files changed, 349 insertions(+), 552 deletions(-) - -diff --git a/arch/arm/cpu/armv8/gxb/firmware/scp_task/cec_tx_reg.h b/arch/arm/cpu/armv8/gxb/firmware/scp_task/cec_tx_reg.h -index 8f4496d..e88be16 100644 ---- a/arch/arm/cpu/armv8/gxb/firmware/scp_task/cec_tx_reg.h -+++ b/arch/arm/cpu/armv8/gxb/firmware/scp_task/cec_tx_reg.h -@@ -197,6 +197,7 @@ typedef unsigned int uint32_t; - #define ONE_TOUCH_PLAY_MASK 1 - #define ONE_TOUCH_STANDBY_MASK 2 - #define AUTO_POWER_ON_MASK 3 -+#define STREAMPATH_POWER_ON_MASK 4 - - //#define P_HHI_GCLK_MPEG2 CBUS_REG_ADDR(HHI_GCLK_MPEG2) - //#define P_HHI_HDMI_CLK_CNTL CBUS_REG_ADDR(HHI_HDMI_CLK_CNTL) -@@ -224,6 +225,13 @@ enum _cec_log_dev_addr_e { - CEC_UNREGISTERED_ADDR - }; - -+typedef enum { -+ POWER_ON = 0x00, -+ POWER_STANDBY, -+ TRANS_STANDBY_TO_ON, -+ TRANS_ON_TO_STANDBY, -+} cec_power_status_e; -+ - typedef enum { - CEC_UNRECONIZED_OPCODE = 0x0, - CEC_NOT_CORRECT_MODE_TO_RESPOND, -@@ -240,37 +248,18 @@ typedef enum { - - /* cec message structure */ - typedef struct { -- unsigned char msg[16]; -+ unsigned char msg[MAX_MSG]; - unsigned char msg_len; --} cec_msg_buf_t; -- --typedef struct { -- cec_msg_buf_t buf[4]; // message memory -- unsigned char power_status; -- unsigned char log_addr; - unsigned char cec_power; -- unsigned char test; -- unsigned char rx_write_pos; -- unsigned char rx_read_pos; -- unsigned char rx_buf_size; -+ unsigned char log_addr; -+ unsigned int phy_addr; - } cec_msg_t; - - cec_msg_t cec_msg; - unsigned long hdmi_cec_func_config; - void cec_node_init(void); --void cec_power_on(void); --void cec_off(void); - unsigned int cec_handler(void); - void remote_cec_hw_reset(void); --unsigned char remote_cec_ll_rx(void); --int remote_cec_ll_tx(unsigned char *msg, unsigned char len); --void cec_wr_reg(unsigned long addr, unsigned long data); --unsigned long cec_rd_reg(unsigned long addr); --void cec_arbit_bit_time_set(unsigned bit_set, unsigned time_set); --//void cec_give_device_power_status(void); --void cec_inactive_source(void); --void cec_set_standby(void); -- - extern void udelay(int i); - - // The following registers are for fine tuning CEC bit timing parameters. -diff --git a/arch/arm/cpu/armv8/gxb/firmware/scp_task/hdmi_cec_arc.c b/arch/arm/cpu/armv8/gxb/firmware/scp_task/hdmi_cec_arc.c -index 33f3d83..79f8dbc 100644 ---- a/arch/arm/cpu/armv8/gxb/firmware/scp_task/hdmi_cec_arc.c -+++ b/arch/arm/cpu/armv8/gxb/firmware/scp_task/hdmi_cec_arc.c -@@ -11,41 +11,23 @@ - #define CEC_DBG_PRINT - #ifdef CEC_DBG_PRINT - #define cec_dbg_print(s,v) {uart_puts(s);uart_put_hex(v,8);} -- #define cec_dbg_prints(s) {uart_puts(s);} -+ #define cec_dbg_printx(s,v,x) {uart_puts(s);uart_put_hex(v,x);} -+ #define cec_dbg_prints(s) {uart_puts(s);wait_uart_empty();} - #else - #define cec_dbg_print(s,v) -+ #define cec_dbg_printx(s,v,x) - #define cec_dbg_prints(s) - #endif - --void cec_reset_addr(void); --struct cec_tx_msg_t { -- unsigned char buf[16]; -- unsigned char retry; -- unsigned char len; --}; -- --#define CEX_TX_MSG_BUF_NUM 8 --#define CEC_TX_MSG_BUF_MASK (CEX_TX_MSG_BUF_NUM - 1) -- --struct cec_tx_msg { -- struct cec_tx_msg_t msg[CEX_TX_MSG_BUF_NUM]; -- unsigned int send_idx; -- unsigned int queue_idx; --}; -- --struct cec_tx_msg cec_tx_msgs = {}; -- -- --int cec_strlen(char *p) -+static int cec_strlen(char *p) - { - int i=0; -- - while (*p++) - i++; - return i; - } - --void *cec_memcpy(void *memto, const void *memfrom, unsigned int size) -+static void *cec_memcpy(void *memto, const void *memfrom, unsigned int size) - { - char *tempfrom = (char *)memfrom; - char *tempto = (char *)memto; -@@ -57,61 +39,46 @@ void *cec_memcpy(void *memto, const void *memfrom, unsigned int size) - return memto; - } - --#define waiting_aocec_free() \ -- do {\ -- unsigned long cnt = 0;\ -- while (readl(P_AO_CEC_RW_REG) & (1<<23))\ -- {\ -- if (5000 == cnt++)\ -- {\ -- break;\ -- }\ -- }\ -- } while(0) -- --unsigned long cec_rd_reg(unsigned long addr) -+static void waiting_aocec_free(void) { -+ unsigned long cnt = 0; -+ while (readl(P_AO_CEC_RW_REG) & (1<<23)) -+ { -+ if (8192 <= cnt++) -+ { -+ cec_dbg_printx("\nWARNING: waiting_aocec_free cnt:0x", cnt, 16); -+ cec_dbg_prints("\n"); -+ break; -+ } -+ } -+} -+ -+static unsigned long cec_rd_reg(unsigned long addr) - { - unsigned long data32; - waiting_aocec_free(); - data32 = 0; -- data32 |= 0 << 16; // [16] cec_reg_wr -- data32 |= 0 << 8; // [15:8] cec_reg_wrdata -- data32 |= addr << 0; // [7:0] cec_reg_addr -+ data32 |= 0 << 16; // [16] cec_reg_wr -+ data32 |= 0 << 8; // [15:8] cec_reg_wrdata -+ data32 |= (addr & 0xff) << 0; // [7:0] cec_reg_addr - writel(data32, P_AO_CEC_RW_REG); - waiting_aocec_free(); - data32 = ((readl(P_AO_CEC_RW_REG)) >> 24) & 0xff; -- return (data32); --} /* cec_rd_reg */ -+ return data32; -+} - --void cec_wr_reg (unsigned long addr, unsigned long data) -+static void cec_wr_reg(unsigned long addr, unsigned long data) - { - unsigned long data32; - waiting_aocec_free(); - data32 = 0; -- data32 |= 1 << 16; // [16] cec_reg_wr -- data32 |= data << 8; // [15:8] cec_reg_wrdata -- data32 |= addr << 0; // [7:0] cec_reg_addr -+ data32 |= 1 << 16; // [16] cec_reg_wr -+ data32 |= (data & 0xff) << 8; // [15:8] cec_reg_wrdata -+ data32 |= (addr & 0xff) << 0; // [7:0] cec_reg_addr - writel(data32, P_AO_CEC_RW_REG); --} /* aocec_wr_only_reg */ -- --void cec_off(void) --{ -- /* -- * [2:1] cntl_clk: 0=Disable clk (Power-off mode); -- * 1=Enable gated clock (Normal mode); -- * 2=Enable free-run clk (Debug mode). -- */ -- writel(0x0, P_AO_CEC_GEN_CNTL); --} -- --void cec_rx_read_pos_plus(void) --{ -- (cec_msg.rx_read_pos == cec_msg.rx_buf_size - 1) ? -- (cec_msg.rx_read_pos = 0) : -- (cec_msg.rx_read_pos++); -+ waiting_aocec_free(); - } - --void cec_arbit_bit_time_set(unsigned bit_set, unsigned time_set) -+static void cec_arbit_bit_time_set(unsigned bit_set, unsigned time_set) - { - //11bit:bit[10:0] - switch (bit_set) { -@@ -134,7 +101,7 @@ void cec_arbit_bit_time_set(unsigned bit_set, unsigned time_set) - } - } - --void cec_hw_buf_clear(void) -+static void cec_hw_buf_clear(void) - { - cec_wr_reg(CEC_RX_MSG_CMD, RX_DISABLE); - cec_wr_reg(CEC_TX_MSG_CMD, TX_ABORT); -@@ -150,7 +117,8 @@ void cec_hw_buf_clear(void) - - void remote_cec_hw_reset(void) - { -- cec_dbg_prints("hw reset\n"); -+ cec_dbg_prints("\nremote_cec_hw_reset\n"); -+ - /* - * clock switch to 32k - */ -@@ -174,561 +142,399 @@ void remote_cec_hw_reset(void) - cec_arbit_bit_time_set(7, 0x2aa); - } - --unsigned char remote_cec_ll_rx(void) --{ -- int i; -- int print = 1; -- unsigned char rx_msg_length = cec_rd_reg(CEC_RX_MSG_LENGTH) + 1; -- -- cec_dbg_prints("cec R:"); -- for (i = 0; i < rx_msg_length; i++) { -- cec_msg.buf[cec_msg.rx_write_pos].msg[i] = cec_rd_reg(CEC_RX_MSG_0_HEADER + i); -- if (print) { -- cec_dbg_print(" ", cec_msg.buf[cec_msg.rx_write_pos].msg[i]); -- } -- if (i == 1 && cec_msg.buf[cec_msg.rx_write_pos].msg[i] == CEC_OC_VENDOR_COMMAND_WITH_ID) { -- /* do not print command with ID */ -- print = 0; -- } -- } -- cec_msg.buf[cec_msg.rx_write_pos].msg_len = rx_msg_length; -- cec_dbg_prints("\n"); -- -- return 0; --} --void cec_buf_clear(void) --{ -- int i; -- -- for (i = 0; i < 16; i++) -- cec_msg.buf[cec_msg.rx_read_pos].msg[i] = 0; --} -- --void cec_tx_buf_init(void) --{ -- int i, j; -- for (j = 0; j < CEX_TX_MSG_BUF_NUM; j++) { -- for (i = 0; i < 16; i++) { -- cec_tx_msgs.msg[j].buf[i] = 0; -- } -- cec_tx_msgs.msg[j].retry = 0; -- cec_tx_msgs.msg[j].len = 0; -- } --} -- --int cec_queue_tx_msg(unsigned char *msg, unsigned char len) --{ -- int s_idx, q_idx; -- -- s_idx = cec_tx_msgs.send_idx; -- q_idx = cec_tx_msgs.queue_idx; -- if (((q_idx + 1) & CEC_TX_MSG_BUF_MASK) == s_idx) { -- cec_dbg_prints("tx buffer full, abort msg\n"); -- cec_reset_addr(); -- return -1; -- } -- if (len && msg) { -- cec_memcpy(cec_tx_msgs.msg[q_idx].buf, msg, len); -- cec_tx_msgs.msg[q_idx].len = len; -- cec_tx_msgs.queue_idx = (q_idx + 1) & CEC_TX_MSG_BUF_MASK; -- } -- return 0; --} -- --int cec_triggle_tx(unsigned char *msg, unsigned char len) --{ -- int i; -- -- if ((TX_IDLE == cec_rd_reg(CEC_TX_MSG_STATUS)) || -- (TX_DONE == cec_rd_reg(CEC_TX_MSG_STATUS))) { -- cec_dbg_prints("cec T:"); -- for (i = 0; i < len; i++) { -- cec_wr_reg(CEC_TX_MSG_0_HEADER + i, msg[i]); -- cec_dbg_print(" ", msg[i]); -- } -- cec_dbg_prints("\n"); -- cec_wr_reg(CEC_TX_MSG_LENGTH, len-1); -- cec_wr_reg(CEC_TX_MSG_CMD, TX_REQ_CURRENT); //TX_REQ_NEXT -- return 0; -- } -- return -1; --} -- --int remote_cec_ll_tx(unsigned char *msg, unsigned char len) --{ -- cec_queue_tx_msg(msg, len); -- cec_triggle_tx(msg, len); -- -- return 0; --} -- --int ping_cec_ll_tx(unsigned char *msg, unsigned char len) -+static int cec_triggle_tx(unsigned char *msg, unsigned char len) - { -- int i; -- int ret = 0; -- unsigned int n = 900; -- unsigned int reg; -- -- ret = cec_rd_reg(CEC_RX_MSG_STATUS); -- cec_dbg_print("rx stat:", ret); -- ret = cec_rd_reg(CEC_TX_MSG_STATUS); -- cec_dbg_print(", tx stat:", ret); -- cec_dbg_prints("\n"); -- -- while (cec_rd_reg(CEC_TX_MSG_STATUS) == TX_BUSY) { -- /* -- * waiting tx to idle if it is busy, other device may in tx state -- */ -- } -- if (cec_rd_reg(CEC_TX_MSG_STATUS) == TX_ERROR) -- cec_wr_reg(CEC_TX_MSG_CMD, TX_NO_OP); -+ unsigned int i, cnt = 0; - -+ cec_dbg_prints(" T:"); - for (i = 0; i < len; i++) { - cec_wr_reg(CEC_TX_MSG_0_HEADER + i, msg[i]); -+ cec_dbg_print(" ", msg[i]); - } -- cec_wr_reg(CEC_TX_MSG_LENGTH, len-1); -- cec_wr_reg(CEC_TX_MSG_CMD, TX_REQ_CURRENT); //TX_REQ_NEXT -- ret = cec_rd_reg(CEC_RX_MSG_STATUS); -- cec_dbg_print("rx stat:", ret); -- ret = cec_rd_reg(CEC_TX_MSG_STATUS); -- cec_dbg_print(", tx stat:", ret); - cec_dbg_prints("\n"); -+ cec_wr_reg(CEC_TX_MSG_LENGTH, len - 1); - -- while (1) { -- reg = cec_rd_reg(CEC_TX_MSG_STATUS); -- if ( reg == TX_DONE ) { -- ret = TX_DONE; -- cec_wr_reg(CEC_TX_MSG_CMD, TX_NO_OP); -- cec_dbg_prints("ping_cec_ll_tx:TX_DONE\n") -- break; -- } -+ do { -+ cec_wr_reg(CEC_TX_MSG_CMD, TX_REQ_CURRENT); -+ cec_wr_reg(CEC_TX_MSG_CMD, TX_NO_OP); -+ cnt++; -+ } while (cec_rd_reg(CEC_TX_NUM_MSG)); - -- if (reg == TX_ERROR) { -- ret = TX_ERROR; -- cec_wr_reg(CEC_TX_MSG_CMD, TX_NO_OP); -- cec_dbg_prints("ping_cec_ll_tx:TX_ERROR\n") -- break; -- } -- if (!(n--)) { -- cec_dbg_prints("ping_cec_ll_tx:TX_BUSY\n") -- ret = TX_BUSY; -- cec_wr_reg(CEC_TX_MSG_CMD, TX_NO_OP); -- break; -- } -- if (reg != TX_BUSY) { -- break; -- } -- _udelay(500); -+ if (cnt > 1) { -+ cec_dbg_printx("WARNING: cec_triggle_tx cnt:0x", cnt, 16); -+ cec_dbg_prints("\n"); - } - -- return ret; -+ _udelay(150); -+ return 0; - } - --void cec_imageview_on(void) --{ -- unsigned char msg[2]; -- -- msg[0] = ((cec_msg.log_addr & 0xf) << 4)| CEC_TV_ADDR; -- msg[1] = CEC_OC_IMAGE_VIEW_ON; -- -- ping_cec_ll_tx(msg, 2); -+#define DEVICE_TV 0 -+#define DEVICE_RECORDER 1 -+#define DEVICE_RESERVED 2 -+#define DEVICE_TUNER 3 -+#define DEVICE_PLAYBACK 4 -+#define DEVICE_AUDIO_SYSTEM 5 -+#define DEVICE_PURE_CEC_SWITCH 6 -+#define DEVICE_VIDEO_PROCESSOR 7 -+ -+static unsigned char log_addr_to_devtype(unsigned char addr) -+{ -+ static unsigned char addr_map[] = { -+ DEVICE_TV, -+ DEVICE_RECORDER, -+ DEVICE_RECORDER, -+ DEVICE_TUNER, -+ DEVICE_PLAYBACK, -+ DEVICE_AUDIO_SYSTEM, -+ DEVICE_TUNER, -+ DEVICE_TUNER, -+ DEVICE_PLAYBACK, -+ DEVICE_RECORDER, -+ DEVICE_TUNER, -+ DEVICE_PLAYBACK, -+ DEVICE_RESERVED, -+ DEVICE_RESERVED, -+ DEVICE_TV, -+ DEVICE_PLAYBACK -+ }; -+ return addr_map[addr & 0xf]; - } - --void cec_report_physical_address(void) -+static void cec_report_physical_address(void) - { - unsigned char msg[5]; -- unsigned char phy_addr_ab = (readl(P_AO_DEBUG_REG1) >> 8) & 0xff; -- unsigned char phy_addr_cd = readl(P_AO_DEBUG_REG1) & 0xff; -+ cec_dbg_prints("cec_report_physical_address\n"); - -- msg[0] = ((cec_msg.log_addr & 0xf) << 4)| CEC_BROADCAST_ADDR; -+ msg[0] = ((cec_msg.log_addr & 0xf) << 4) | CEC_BROADCAST_ADDR; - msg[1] = CEC_OC_REPORT_PHYSICAL_ADDRESS; -- msg[2] = phy_addr_ab; -- msg[3] = phy_addr_cd; -- msg[4] = CEC_PLAYBACK_DEVICE_TYPE; -+ msg[2] = (cec_msg.phy_addr >> 8) & 0xff; -+ msg[3] = (cec_msg.phy_addr >> 0) & 0xff; -+ msg[4] = log_addr_to_devtype(cec_msg.log_addr); - -- remote_cec_ll_tx(msg, 5); -+ cec_triggle_tx(msg, 5); - } - --void cec_report_device_power_status(void) -+static void cec_report_power_status(unsigned char initiator) - { - unsigned char msg[3]; -+ cec_dbg_printx("cec_report_power_status initiator:0x", initiator, 4); -+ cec_dbg_prints("\n"); - -- msg[0] = ((cec_msg.log_addr & 0xf) << 4)| CEC_TV_ADDR; -+ msg[0] = ((cec_msg.log_addr & 0xf) << 4) | (initiator & 0xf); - msg[1] = CEC_OC_REPORT_POWER_STATUS; -- msg[2] = cec_msg.power_status; -+ msg[2] = POWER_STANDBY; - -- remote_cec_ll_tx(msg, 3); -+ cec_triggle_tx(msg, 3); - } - --void cec_set_stream_path(void) -+static void cec_feature_abort(unsigned char reason, unsigned char initiator) - { -- unsigned char phy_addr_ab = (readl(P_AO_DEBUG_REG1) >> 8) & 0xff; -- unsigned char phy_addr_cd = readl(P_AO_DEBUG_REG1) & 0xff; -- -- if ((hdmi_cec_func_config >> CEC_FUNC_MASK) & 0x1) { -- if ((hdmi_cec_func_config >> AUTO_POWER_ON_MASK) & 0x1) { -- if ((phy_addr_ab == cec_msg.buf[cec_msg.rx_read_pos].msg[2]) && -- (phy_addr_cd == cec_msg.buf[cec_msg.rx_read_pos].msg[3])) { -- cec_msg.cec_power = 0x1; -- } -- } -- } -+ unsigned char msg[4]; -+ cec_dbg_print("cec_feature_abort reason:0x", reason); -+ cec_dbg_printx(", initiator:0x", initiator, 4); -+ cec_dbg_prints("\n"); -+ -+ msg[0] = ((cec_msg.log_addr & 0xf) << 4) | (initiator & 0xf); -+ msg[1] = CEC_OC_FEATURE_ABORT; -+ msg[2] = cec_msg.msg[1]; -+ msg[3] = reason; -+ -+ cec_triggle_tx(msg, 4); - } - --void cec_device_vendor_id(void) -+static void cec_menu_status(unsigned char menu_status, unsigned char initiator) - { -- unsigned char msg[5]; -+ unsigned char msg[3]; -+ cec_dbg_print("cec_menu_status menu_status:0x", menu_status); -+ cec_dbg_printx(", initiator:0x", initiator, 4); -+ cec_dbg_prints("\n"); - -- msg[0] = ((cec_msg.log_addr & 0xf) << 4)| CEC_BROADCAST_ADDR; -- msg[1] = CEC_OC_DEVICE_VENDOR_ID; -- msg[2] = 0x00; -- msg[3] = 0x00; -- msg[4] = 0x00; -+ msg[0] = ((cec_msg.log_addr & 0xf) << 4) | (initiator & 0xf); -+ msg[1] = CEC_OC_MENU_STATUS; -+ msg[2] = menu_status; - -- remote_cec_ll_tx(msg, 5); -+ cec_triggle_tx(msg, 3); - } - --void cec_feature_abort(void) -+static void cec_set_stream_path(unsigned char initiator) - { -- if (cec_msg.buf[cec_msg.rx_read_pos].msg[1] != 0xf) { -- unsigned char msg[4]; -- -- msg[0] = ((cec_msg.log_addr & 0xf) << 4) | CEC_TV_ADDR; -- msg[1] = CEC_OC_FEATURE_ABORT; -- msg[2] = cec_msg.buf[cec_msg.rx_read_pos].msg[1]; -- msg[3] = CEC_UNRECONIZED_OPCODE; -+ unsigned int phy_addr = (cec_msg.msg[2] << 8) | cec_msg.msg[3]; -+ cec_dbg_printx("cec_set_stream_path initiator:0x", initiator, 4); -+ cec_dbg_printx(", phy_addr:0x", phy_addr, 16); -+ cec_dbg_prints("\n"); - -- remote_cec_ll_tx(msg, 4); -+ if ((hdmi_cec_func_config >> STREAMPATH_POWER_ON_MASK) & 0x1) { -+ if (cec_msg.phy_addr == phy_addr && initiator == CEC_TV_ADDR) { -+ cec_msg.cec_power = 0x1; -+ } - } - } - --void cec_menu_status_smp(int menu_status) -+static void cec_routing_change(unsigned char initiator) - { -- unsigned char msg[3]; -- -- msg[0] = ((cec_msg.log_addr & 0xf) << 4)| CEC_TV_ADDR; -- msg[1] = CEC_OC_MENU_STATUS; -- msg[2] = menu_status; -+ unsigned int phy_addr = (cec_msg.msg[4] << 8) | cec_msg.msg[5]; -+ cec_dbg_printx("cec_routing_change initiator:0x", initiator, 4); -+ cec_dbg_printx(", phy_addr:0x", phy_addr, 16); -+ cec_dbg_prints("\n"); - -- remote_cec_ll_tx(msg, 3); -+ if ((hdmi_cec_func_config >> STREAMPATH_POWER_ON_MASK) & 0x1) { -+ if (cec_msg.phy_addr == phy_addr && initiator == CEC_TV_ADDR) { -+ cec_msg.cec_power = 0x1; -+ } -+ } - } - --void cec_inactive_source(void) -+static void cec_user_control_pressed(void) - { -- unsigned char msg[4]; -- unsigned char phy_addr_ab = (readl(P_AO_DEBUG_REG1) >> 8) & 0xff; -- unsigned char phy_addr_cd = readl(P_AO_DEBUG_REG1) & 0xff; -- -- msg[0] = ((cec_msg.log_addr & 0xf) << 4) | CEC_TV_ADDR; -- msg[1] = CEC_OC_INACTIVE_SOURCE; -- msg[2] = phy_addr_ab; -- msg[3] = phy_addr_cd; -+ cec_dbg_print("cec_user_control_pressed operation:0x", cec_msg.msg[2]); -+ cec_dbg_prints("\n"); - -- remote_cec_ll_tx(msg, 4); -+ if ((hdmi_cec_func_config >> ONE_TOUCH_STANDBY_MASK) & 0x1) { -+ if ((0x40 == cec_msg.msg[2]) || // Power -+ (0x6b == cec_msg.msg[2]) || // Power Toggle Function -+ (0x6d == cec_msg.msg[2]) || // Power On Function -+ (0x0a == cec_msg.msg[2]) || // Setup Menu -+ (0x0b == cec_msg.msg[2]) || // Contents Menu -+ (0x10 == cec_msg.msg[2]) || // Media Top Menu -+ (0x11 == cec_msg.msg[2]) || // Media Context-sensitive Menu -+ (0x09 == cec_msg.msg[2])) { // Root Menu -+ cec_msg.cec_power = 0x1; -+ } -+ } - } - --void cec_set_standby(void) -+static void cec_device_vendor_id(void) - { -- unsigned char msg[2]; -+ unsigned char msg[5]; -+ cec_dbg_prints("cec_device_vendor_id\n"); -+ - msg[0] = ((cec_msg.log_addr & 0xf) << 4) | CEC_BROADCAST_ADDR; -- msg[1] = CEC_OC_STANDBY; -+ msg[1] = CEC_OC_DEVICE_VENDOR_ID; -+ msg[2] = 0x00; -+ msg[3] = 0x00; -+ msg[4] = 0x00; - -- remote_cec_ll_tx(msg, 2); -+ cec_triggle_tx(msg, 5); - } - --void cec_give_deck_status(void) -+static void cec_deck_status(unsigned char initiator) - { - unsigned char msg[3]; -+ cec_dbg_printx("cec_deck_status initiator:0x", initiator, 4); -+ cec_dbg_prints("\n"); - -- msg[0] = ((cec_msg.log_addr & 0xf) << 4) | CEC_TV_ADDR; -+ msg[0] = ((cec_msg.log_addr & 0xf) << 4) | (initiator & 0xf); - msg[1] = CEC_OC_DECK_STATUS; -- msg[2] = 0x1a; -+ msg[2] = 0x1a; // DECK_STOP - -- remote_cec_ll_tx(msg, 3); -+ cec_triggle_tx(msg, 3); - } - --void cec_set_osd_name(void) -+static void cec_set_osd_name(unsigned char initiator) - { - unsigned char msg[16]; - unsigned char osd_len = cec_strlen(CONFIG_CEC_OSD_NAME); -+ cec_dbg_printx("cec_set_osd_name initiator:0x", initiator, 4); -+ cec_dbg_prints("\n"); - -- msg[0] = ((cec_msg.log_addr & 0xf) << 4) | CEC_TV_ADDR; -+ msg[0] = ((cec_msg.log_addr & 0xf) << 4) | (initiator & 0xf); - msg[1] = CEC_OC_SET_OSD_NAME; - cec_memcpy(&msg[2], CONFIG_CEC_OSD_NAME, osd_len); - -- remote_cec_ll_tx(msg, osd_len + 2); -+ cec_triggle_tx(msg, osd_len + 2); - } - --void cec_get_version(void) -+static void cec_get_version(unsigned char initiator) - { -- unsigned char dest_log_addr = cec_msg.log_addr & 0xf; - unsigned char msg[3]; -+ cec_dbg_printx("cec_get_version initiator:0x", initiator, 4); -+ cec_dbg_prints("\n"); - -- if (0xf != dest_log_addr) { -- msg[0] = ((cec_msg.log_addr & 0xf) << 4) | CEC_TV_ADDR; -- msg[1] = CEC_OC_CEC_VERSION; -- msg[2] = CEC_VERSION_14A; -- remote_cec_ll_tx(msg, 3); -- } -+ msg[0] = ((cec_msg.log_addr & 0xf) << 4) | (initiator & 0xf); -+ msg[1] = CEC_OC_CEC_VERSION; -+ msg[2] = CEC_VERSION_14A; -+ -+ cec_triggle_tx(msg, 3); - } - --unsigned int cec_handle_message(void) -+static unsigned int cec_handle_message(void) - { -- unsigned char opcode; -- -- if (((hdmi_cec_func_config>>CEC_FUNC_MASK) & 0x1) && -- (cec_msg.buf[cec_msg.rx_read_pos].msg_len > 1)) { -- opcode = cec_msg.buf[cec_msg.rx_read_pos].msg[1]; -- switch (opcode) { -- case CEC_OC_GET_CEC_VERSION: -- cec_get_version(); -- break; -- case CEC_OC_GIVE_DECK_STATUS: -- cec_give_deck_status(); -- break; -- case CEC_OC_GIVE_PHYSICAL_ADDRESS: -- cec_report_physical_address(); -- break; -- case CEC_OC_GIVE_DEVICE_VENDOR_ID: -- cec_device_vendor_id(); -- break; -- case CEC_OC_GIVE_OSD_NAME: -- cec_set_osd_name(); -- break; -- case CEC_OC_SET_STREAM_PATH: -- cec_set_stream_path(); -- break; -- case CEC_OC_GIVE_DEVICE_POWER_STATUS: -- cec_report_device_power_status(); -- break; -- case CEC_OC_USER_CONTROL_PRESSED: -- if (((hdmi_cec_func_config >> CEC_FUNC_MASK) & 0x1) && -- ((hdmi_cec_func_config >> AUTO_POWER_ON_MASK) & 0x1) && -- (cec_msg.buf[cec_msg.rx_read_pos].msg_len == 3) && -- ((0x40 == cec_msg.buf[cec_msg.rx_read_pos].msg[2]) || -- (0x6d == cec_msg.buf[cec_msg.rx_read_pos].msg[2]) || -- (0x09 == cec_msg.buf[cec_msg.rx_read_pos].msg[2]) )) { -- cec_msg.cec_power = 0x1; -- } -- break; -- case CEC_OC_MENU_REQUEST: -- cec_menu_status_smp(DEVICE_MENU_INACTIVE); -- break; -- default: -- break; -+ unsigned char initiator = (cec_msg.msg[0] >> 4) & 0xf; -+ unsigned char destination = cec_msg.msg[0] & 0xf; -+ unsigned char opcode = (cec_msg.msg_len > 1) ? cec_msg.msg[1] : CEC_OC_POLLING_MESSAGE; -+ unsigned char directly_addressed = (destination != CEC_BROADCAST_ADDR && destination == cec_msg.log_addr); -+ -+ cec_dbg_printx("cec_handle_message initiator:0x", initiator, 4); -+ cec_dbg_printx(", destination:0x", destination, 4); -+ cec_dbg_print(", opcode:0x", opcode); -+ cec_dbg_prints("\n"); -+ -+ switch (opcode) { -+ case CEC_OC_POLLING_MESSAGE: -+ break; -+ case CEC_OC_GET_CEC_VERSION: -+ if (directly_addressed) -+ cec_get_version(initiator); -+ break; -+ case CEC_OC_GIVE_DECK_STATUS: -+ cec_deck_status(initiator); -+ break; -+ case CEC_OC_GIVE_PHYSICAL_ADDRESS: -+ cec_report_physical_address(); -+ break; -+ case CEC_OC_GIVE_DEVICE_VENDOR_ID: -+ cec_device_vendor_id(); -+ break; -+ case CEC_OC_VENDOR_COMMAND: -+ case CEC_OC_VENDOR_COMMAND_WITH_ID: -+ break; -+ case CEC_OC_GIVE_OSD_NAME: -+ if (directly_addressed) -+ cec_set_osd_name(initiator); -+ break; -+ case CEC_OC_SET_STREAM_PATH: -+ cec_set_stream_path(initiator); -+ break; -+ case CEC_OC_ROUTING_CHANGE: -+ cec_routing_change(initiator); -+ break; -+ case CEC_OC_GIVE_DEVICE_POWER_STATUS: -+ if (directly_addressed) -+ cec_report_power_status(initiator); -+ break; -+ case CEC_OC_USER_CONTROL_PRESSED: -+ if (directly_addressed) -+ cec_user_control_pressed(); -+ break; -+ case CEC_OC_USER_CONTROL_RELEASED: -+ break; -+ case CEC_OC_MENU_REQUEST: -+ if (directly_addressed) -+ cec_menu_status(DEVICE_MENU_INACTIVE, initiator); -+ break; -+ case CEC_OC_ABORT_MESSAGE: -+ if (directly_addressed) -+ cec_feature_abort(CEC_UNRECONIZED_OPCODE, initiator); -+ break; -+ default: -+ if (directly_addressed) { -+ cec_dbg_print("WARNING: unhandled directly addressed opcode:0x", opcode); -+ cec_dbg_prints("\n"); -+ cec_feature_abort(CEC_UNABLE_TO_DETERMINE, initiator); - } -+ break; - } -- cec_rx_read_pos_plus(); - return 0; - } - --void cec_reset_addr(void) -+static unsigned int cec_tx_irq_handler(void) - { -- remote_cec_hw_reset(); -- cec_wr_reg(CEC_LOGICAL_ADDR0, 0); -- cec_hw_buf_clear(); -- cec_wr_reg(CEC_LOGICAL_ADDR0, cec_msg.log_addr); -- _udelay(100); -- cec_wr_reg(CEC_LOGICAL_ADDR0, (0x1 << 4) | cec_msg.log_addr); -+ unsigned int cnt = 0; -+ unsigned int tx_msg_status = cec_rd_reg(CEC_TX_MSG_STATUS); -+ unsigned int tx_num_msg = cec_rd_reg(CEC_TX_NUM_MSG); -+ cec_dbg_printx("cec_tx_irq_handler tx_msg_status:0x", tx_msg_status, 4); -+ cec_dbg_printx(", tx_num_msg:0x", tx_num_msg, 4); -+ cec_dbg_prints("\n"); -+ -+ do { -+ cec_wr_reg(CEC_TX_MSG_CMD, TX_NO_OP); -+ cnt++; -+ } while (cec_rd_reg(CEC_TX_NUM_MSG)); -+ writel((1 << 1), P_AO_CEC_INTR_CLR); -+ -+ if (cnt > 1) { -+ cec_dbg_printx("WARNING: cec_tx_irq_handler cnt:0x", cnt, 16); -+ cec_dbg_prints("\n"); -+ } -+ -+ return 0; - } - --unsigned int cec_handler(void) -+static unsigned int cec_rx_irq_handler(void) - { -- unsigned char s_idx; -- static int busy_count = 0; -- if (0xf == cec_rd_reg(CEC_RX_NUM_MSG)) { -- cec_wr_reg(CEC_RX_CLEAR_BUF, 0x1); -- cec_wr_reg(CEC_RX_CLEAR_BUF, 0x0); -- cec_wr_reg(CEC_RX_MSG_CMD, RX_ACK_CURRENT); -- cec_wr_reg(CEC_RX_MSG_CMD, RX_NO_OP); -- cec_dbg_prints("error:hw_buf overflow\n"); -- } -+ unsigned int cnt = 0; -+ unsigned int rx_msg_status = cec_rd_reg(CEC_RX_MSG_STATUS); -+ unsigned int rx_num_msg = cec_rd_reg(CEC_RX_NUM_MSG); -+ cec_dbg_printx("cec_rx_irq_handler rx_msg_status:0x", rx_msg_status, 4); -+ cec_dbg_printx(", rx_num_msg:0x", rx_num_msg, 4); -+ cec_dbg_prints("\n"); - -- switch (cec_rd_reg(CEC_RX_MSG_STATUS)) { -- case RX_DONE: -- if (1 == cec_rd_reg(CEC_RX_NUM_MSG)) { -- remote_cec_ll_rx(); -- (cec_msg.rx_write_pos == cec_msg.rx_buf_size - 1) ? (cec_msg.rx_write_pos = 0) : (cec_msg.rx_write_pos++); -+ if (rx_num_msg) { -+ unsigned int i, rx_msg_length = cec_rd_reg(CEC_RX_MSG_LENGTH) + 1; -+ cec_dbg_prints(" R:"); -+ for (i = 0; i < rx_msg_length && i < MAX_MSG; i++) { -+ cec_msg.msg[i] = cec_rd_reg(CEC_RX_MSG_0_HEADER + i); -+ cec_dbg_print(" ", cec_msg.msg[i]); - } -- cec_wr_reg(CEC_RX_MSG_CMD, RX_ACK_CURRENT); -- cec_wr_reg(CEC_RX_MSG_CMD, RX_NO_OP); -- cec_dbg_prints("RX_OK\n"); -- break; -- case RX_ERROR: -- cec_dbg_prints("RX_ERROR\n"); -- if (TX_ERROR == cec_rd_reg(CEC_TX_MSG_STATUS)) { -- cec_dbg_prints("TX_ERROR\n"); -- cec_reset_addr(); -- } else { -- cec_dbg_prints("TX_other\n"); -- cec_wr_reg(CEC_RX_MSG_CMD, RX_ACK_CURRENT); -- cec_wr_reg(CEC_RX_MSG_CMD, RX_NO_OP); -+ for (; i < MAX_MSG; i++) { -+ cec_msg.msg[i] = 0x0; - } -- break; -- default: -- break; -+ cec_msg.msg_len = rx_msg_length; -+ cec_dbg_prints("\n"); - } - -- switch (cec_rd_reg(CEC_TX_MSG_STATUS)) { -- case TX_DONE: -- cec_wr_reg(CEC_TX_MSG_CMD, TX_NO_OP); -- cec_tx_msgs.send_idx = (cec_tx_msgs.send_idx + 1) & CEC_TX_MSG_BUF_MASK; -- s_idx = cec_tx_msgs.send_idx; -- if (cec_tx_msgs.send_idx != cec_tx_msgs.queue_idx) { -- cec_dbg_prints("TX_OK\n"); -- cec_triggle_tx(cec_tx_msgs.msg[s_idx].buf, -- cec_tx_msgs.msg[s_idx].len); -- } else { -- cec_dbg_prints("TX_END\n"); -- } -- busy_count = 0; -- break; -+ do { -+ cec_wr_reg(CEC_RX_MSG_CMD, RX_ACK_CURRENT); -+ cec_wr_reg(CEC_RX_MSG_CMD, RX_NO_OP); -+ cnt++; -+ } while (cec_rd_reg(CEC_RX_NUM_MSG)); -+ writel((1 << 2), P_AO_CEC_INTR_CLR); - -- case TX_ERROR: -- cec_dbg_prints("@TX_ERROR\n"); -- if (RX_ERROR == cec_rd_reg(CEC_RX_MSG_STATUS)) { -- cec_dbg_prints("@RX_ERROR\n"); -- cec_reset_addr(); -- } else { -- cec_wr_reg(CEC_TX_MSG_CMD, TX_NO_OP); -- s_idx = cec_tx_msgs.send_idx; -- if (cec_tx_msgs.msg[s_idx].retry < 5) { -- cec_tx_msgs.msg[s_idx].retry++; -- cec_triggle_tx(cec_tx_msgs.msg[s_idx].buf, -- cec_tx_msgs.msg[s_idx].len); -- } else { -- cec_dbg_prints("TX retry too much, abort msg\n"); -- cec_tx_msgs.send_idx = (cec_tx_msgs.send_idx + 1) & CEC_TX_MSG_BUF_MASK; -- } -- } -- busy_count = 0; -- break; -+ if (cnt > 2) { -+ cec_dbg_printx("WARNING: cec_rx_irq_handler cnt:0x", cnt, 16); -+ cec_dbg_prints("\n"); -+ } - -- case TX_IDLE: -- s_idx = cec_tx_msgs.send_idx; -- if (cec_tx_msgs.send_idx != cec_tx_msgs.queue_idx) { // triggle tx if idle -- cec_triggle_tx(cec_tx_msgs.msg[s_idx].buf, -- cec_tx_msgs.msg[s_idx].len); -- } -- busy_count = 0; -- break; -+ if (rx_num_msg) -+ cec_handle_message(); - -- case TX_BUSY: -- busy_count++; -- if (busy_count >= 2000) { -- uart_puts("busy too long, reset hw\n"); -- cec_reset_addr(); -- busy_count = 0; -- } -- break; -+ return 0; -+} - -- default: -- break; -+unsigned int cec_handler(void) -+{ -+ unsigned int intr_stat = readl(P_AO_CEC_INTR_STAT); -+ if (intr_stat & (1<<1)) { -+ cec_tx_irq_handler(); - } -- if (cec_msg.rx_read_pos != cec_msg.rx_write_pos) { -- cec_handle_message(); -+ if (intr_stat & (1<<2)) { -+ cec_rx_irq_handler(); - } -- - return 0; - } - - void cec_node_init(void) - { -- static int i = 0; -- static unsigned int retry = 0; -- static int regist_devs = 0; -- static enum _cec_log_dev_addr_e *probe = NULL; -- -- int tx_stat; -- unsigned char msg[1]; -- unsigned int kern_log_addr = (readl(P_AO_DEBUG_REG1) >> 16) & 0xf; -- enum _cec_log_dev_addr_e player_dev[3][3] = -- {{CEC_PLAYBACK_DEVICE_1_ADDR, CEC_PLAYBACK_DEVICE_2_ADDR, CEC_PLAYBACK_DEVICE_3_ADDR}, -- {CEC_PLAYBACK_DEVICE_2_ADDR, CEC_PLAYBACK_DEVICE_3_ADDR, CEC_PLAYBACK_DEVICE_1_ADDR}, -- {CEC_PLAYBACK_DEVICE_3_ADDR, CEC_PLAYBACK_DEVICE_1_ADDR, CEC_PLAYBACK_DEVICE_2_ADDR}}; -- -- if (retry >= 12) { // retry all device addr -- cec_msg.log_addr = 0x0f; -- uart_puts("failed on retried all possible address\n"); -- return ; -- } -- if (probe == NULL) { -- cec_msg.rx_read_pos = 0; -- cec_msg.rx_write_pos = 0; -- cec_msg.rx_buf_size = 4; -- -- cec_msg.power_status = 1; -- cec_msg.cec_power = 0; -- cec_msg.test = 0x0; -- cec_tx_msgs.send_idx = 0; -- cec_tx_msgs.queue_idx = 0; -- cec_tx_buf_init(); -- cec_buf_clear(); -- cec_wr_reg(CEC_LOGICAL_ADDR0, 0); -- cec_hw_buf_clear(); -- cec_wr_reg(CEC_LOGICAL_ADDR0, 0xf); -- _udelay(100); -- cec_wr_reg(CEC_LOGICAL_ADDR0, (0x1 << 4) | 0xf); -- /* -- * use kernel cec logic address to detect which logic address is the -- * started one to allocate. -- */ -- cec_dbg_print("kern log_addr:0x", kern_log_addr); -- uart_puts("\n"); -- for (i = 0; i < 3; i++) { -- if (kern_log_addr == player_dev[i][0]) { -- probe = player_dev[i]; -- break; -- } -- } -- if (probe == NULL) { -- probe = player_dev[0]; -- } -- i = 0; -- } -+ unsigned int phy_addr = readl(P_AO_DEBUG_REG1) & 0xffff; -+ unsigned char log_addr = readl(P_AO_DEBUG_REG3) & 0xf; - -- msg[0] = (probe[i]<<4) | probe[i]; -- tx_stat = ping_cec_ll_tx(msg, 1); -- if (tx_stat == TX_BUSY) { // can't get cec bus -- retry++; -- remote_cec_hw_reset(); -- if (!(retry & 0x03)) { -- cec_dbg_print("retry too much, log_addr:0x", probe[i]); -- uart_puts("\n"); -- } else { -- i -= 1; -- } -- } else if (tx_stat == TX_ERROR) { -- cec_wr_reg(CEC_LOGICAL_ADDR0, 0); -- cec_hw_buf_clear(); -- cec_wr_reg(CEC_LOGICAL_ADDR0, probe[i]); -- _udelay(100); -- cec_wr_reg(CEC_LOGICAL_ADDR0, (0x1 << 4) | probe[i]); -- cec_msg.log_addr = probe[i]; -- cec_dbg_print("Set cec log_addr:0x", cec_msg.log_addr); -- cec_dbg_print(", ADDR0:", cec_rd_reg(CEC_LOGICAL_ADDR0)); -- uart_puts("\n"); -- probe = NULL; -- regist_devs = 0; -- i = 0; -- retry = 0; -- return ; -- } else if (tx_stat == TX_DONE) { -- cec_dbg_print("sombody takes cec log_addr:0x", probe[i]); -- uart_puts("\n"); -- regist_devs |= (1 << i); -- retry += (4 - (retry & 0x03)); -- if (regist_devs == 0x07) { -- // No avilable logical address -- cec_msg.log_addr = 0x0f; -- cec_wr_reg(CEC_LOGICAL_ADDR0, (0x1 << 4) | 0xf); -- uart_puts("CEC allocate logic address failed\n"); -- } -- } -- i++; -- if (i == 3) { -- i = 0; -+ cec_dbg_print("cec_node_init cec_config:0x", hdmi_cec_func_config); -+ cec_dbg_printx(", log_addr:0x", log_addr, 4); -+ cec_dbg_printx(", phy_addr:0x", phy_addr, 16); -+ cec_dbg_prints("\n"); -+ -+ cec_msg.msg_len = 0; -+ cec_msg.cec_power = 0; -+ cec_msg.log_addr = log_addr; -+ cec_msg.phy_addr = phy_addr; -+ -+ if (!cec_msg.log_addr || !cec_msg.phy_addr) { -+ cec_dbg_prints("WARNING: log/phy_addr is not set, disabling cec wakeup\n"); -+ hdmi_cec_func_config = hdmi_cec_func_config & ~(0x1 << CEC_FUNC_MASK); -+ return; - } -+ -+ cec_wr_reg(CEC_LOGICAL_ADDR0, 0); -+ cec_hw_buf_clear(); -+ cec_wr_reg(CEC_LOGICAL_ADDR0, log_addr); -+ _udelay(100); -+ cec_wr_reg(CEC_LOGICAL_ADDR0, (0x1 << 4) | log_addr); -+ _udelay(100); -+ -+ cec_report_physical_address(); -+ cec_device_vendor_id(); -+ cec_set_osd_name(CEC_TV_ADDR); - } - - #endif -diff --git a/arch/arm/cpu/armv8/gxb/firmware/scp_task/suspend.c b/arch/arm/cpu/armv8/gxb/firmware/scp_task/suspend.c -index 5db0e69..b16910c 100644 ---- a/arch/arm/cpu/armv8/gxb/firmware/scp_task/suspend.c -+++ b/arch/arm/cpu/armv8/gxb/firmware/scp_task/suspend.c -@@ -70,15 +70,15 @@ void enter_suspend(unsigned int suspend_from) - p_pwr_op = &pwr_op_d; - pwr_op_init(p_pwr_op); - --/* - // FIXME : (1) BLUE LED GPIOAO_13 (2) Current issue 12*mA -> 7*mA - #ifdef CONFIG_CEC_WAKEUP -- hdmi_cec_func_config = readl(P_AO_DEBUG_REG0); -+ hdmi_cec_func_config = readl(P_AO_DEBUG_REG0) & 0xff; -+ wait_uart_empty(); - uart_puts("CEC cfg:0x"); -- uart_put_hex(hdmi_cec_func_config, 16); -+ uart_put_hex(hdmi_cec_func_config, 8); - uart_puts("\n"); -+ wait_uart_empty(); - #endif --*/ - p_pwr_op->power_off_at_clk81(); - p_pwr_op->power_off_at_24M(); - -diff --git a/arch/arm/cpu/armv8/gxb/firmware/scp_task/task_apis.h b/arch/arm/cpu/armv8/gxb/firmware/scp_task/task_apis.h -index fe6bd75..6ec5486 100644 ---- a/arch/arm/cpu/armv8/gxb/firmware/scp_task/task_apis.h -+++ b/arch/arm/cpu/armv8/gxb/firmware/scp_task/task_apis.h -@@ -14,8 +14,8 @@ int uart_puts(const char *s); - - /* #define dbg_print(s,v) */ - /* #define dbg_prints(s) */ --#define writel(v, addr) (*((unsigned *)addr) = v) --#define readl(addr) (*((unsigned *)addr)) -+#define writel(v, addr) (*((volatile unsigned *)addr) = v) -+#define readl(addr) (*((volatile unsigned *)addr)) - - #define dbg_print(s, v) {uart_puts(s); uart_put_hex(v, 32); uart_puts("\n"); } - /* #define dbg_prints(s) {uart_puts(s);wait_uart_empty();} */ -diff --git a/board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c b/board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c -index f6f2a7d..aa902be 100644 ---- a/board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c -+++ b/board/hardkernel/odroidc2/firmware/scp_task/pwr_ctrl.c -@@ -8,6 +8,8 @@ - - #ifdef CONFIG_CEC_WAKEUP - #include -+#else -+typedef unsigned int uint32_t; - #endif - - extern int pwm_voltage_table[31][2]; -@@ -227,7 +229,7 @@ unsigned int detect_key(unsigned int suspend_from) - unsigned int init_time = get_time(); - init_remote(); - #ifdef CONFIG_CEC_WAKEUP -- if (hdmi_cec_func_config & 0x1) { -+ if ((hdmi_cec_func_config >> CEC_FUNC_MASK) & 0x1) { - remote_cec_hw_reset(); - cec_node_init(); - } -@@ -236,19 +238,19 @@ unsigned int detect_key(unsigned int suspend_from) - set_custom_gpio_status(); - - do { -- #ifdef CONFIG_CEC_WAKEUP -- if (cec_msg.log_addr) { -- if (hdmi_cec_func_config & 0x1) { -+#ifdef CONFIG_CEC_WAKEUP -+ if ((hdmi_cec_func_config >> CEC_FUNC_MASK) & 0x1) { -+ if (cec_msg.log_addr) { - cec_handler(); - if (cec_msg.cec_power == 0x1) { //cec power key - exit_reason = CEC_WAKEUP; - break; - } -+ } else { -+ cec_node_init(); - } -- } else if (hdmi_cec_func_config & 0x1) { -- cec_node_init(); - } -- #endif -+#endif - #if 0 - if ((readl(AO_GPIO_I) & (1<<3)) == 0) { - exit_reason = POWER_KEY_WAKEUP; diff --git a/projects/Odroid_C2/patches/u-boot/u-boot-0002-update_cec_wakeup_code.patch b/projects/Odroid_C2/patches/u-boot/u-boot-0002-update_cec_wakeup_code.patch new file mode 100644 index 0000000000..d8e5c0916c --- /dev/null +++ b/projects/Odroid_C2/patches/u-boot/u-boot-0002-update_cec_wakeup_code.patch @@ -0,0 +1,225 @@ +From c2ebdfc8d2a03f583410db24bb8086044e9c72bb Mon Sep 17 00:00:00 2001 +From: Jonas Karlman +Date: Wed, 7 Sep 2016 20:55:24 +0200 +Subject: [PATCH] Update CEC wakeup code + +This also removes the forced cec config +--- + .../cpu/armv8/gxb/firmware/scp_task/hdmi_cec_arc.c | 102 ++++++++++++--------- + arch/arm/cpu/armv8/gxb/firmware/scp_task/suspend.c | 2 - + 2 files changed, 58 insertions(+), 46 deletions(-) + +diff --git a/arch/arm/cpu/armv8/gxb/firmware/scp_task/hdmi_cec_arc.c b/arch/arm/cpu/armv8/gxb/firmware/scp_task/hdmi_cec_arc.c +index 969777f..7d397ca 100644 +--- a/arch/arm/cpu/armv8/gxb/firmware/scp_task/hdmi_cec_arc.c ++++ b/arch/arm/cpu/armv8/gxb/firmware/scp_task/hdmi_cec_arc.c +@@ -41,7 +41,7 @@ static void *cec_memcpy(void *memto, const void *memfrom, unsigned int size) + } + + static void waiting_aocec_free(void) { +- unsigned int cnt = 0; ++ unsigned long cnt = 0; + while (readl(P_AO_CEC_RW_REG) & (1<<23)) + { + if (8192 <= cnt++) +@@ -146,8 +146,6 @@ void remote_cec_hw_reset(void) + static int cec_triggle_tx(unsigned char *msg, unsigned char len) + { + unsigned int i, cnt = 0; +- cec_dbg_print("cec_triggle_tx len:0x", len); +- cec_dbg_prints("\n"); + + cec_dbg_prints(" T:"); + for (i = 0; i < len; i++) { +@@ -168,6 +166,7 @@ static int cec_triggle_tx(unsigned char *msg, unsigned char len) + cec_dbg_prints("\n"); + } + ++ _udelay(150); + return 0; + } + +@@ -180,7 +179,7 @@ static int cec_triggle_tx(unsigned char *msg, unsigned char len) + #define DEVICE_PURE_CEC_SWITCH 6 + #define DEVICE_VIDEO_PROCESSOR 7 + +-static unsigned char log_addr_to_devtype(unsigned int addr) ++static unsigned char log_addr_to_devtype(unsigned char addr) + { + static unsigned char addr_map[] = { + DEVICE_TV, +@@ -211,7 +210,7 @@ static void cec_report_physical_address(void) + msg[0] = ((cec_msg.log_addr & 0xf) << 4) | CEC_BROADCAST_ADDR; + msg[1] = CEC_OC_REPORT_PHYSICAL_ADDRESS; + msg[2] = (cec_msg.phy_addr >> 8) & 0xff; +- msg[3] = cec_msg.phy_addr & 0xff; ++ msg[3] = (cec_msg.phy_addr >> 0) & 0xff; + msg[4] = log_addr_to_devtype(cec_msg.log_addr); + + cec_triggle_tx(msg, 5); +@@ -245,18 +244,44 @@ static void cec_feature_abort(unsigned char reason, unsigned char initiator) + cec_triggle_tx(msg, 4); + } + +-static void cec_set_stream_path(void) ++static void cec_menu_status(unsigned char menu_status, unsigned char initiator) ++{ ++ unsigned char msg[3]; ++ cec_dbg_print("cec_menu_status menu_status:0x", menu_status); ++ cec_dbg_printx(", initiator:0x", initiator, 4); ++ cec_dbg_prints("\n"); ++ ++ msg[0] = ((cec_msg.log_addr & 0xf) << 4) | (initiator & 0xf); ++ msg[1] = CEC_OC_MENU_STATUS; ++ msg[2] = menu_status; ++ ++ cec_triggle_tx(msg, 3); ++} ++ ++static void cec_set_stream_path(unsigned char initiator) + { +- unsigned char phy_addr_ab = (cec_msg.phy_addr >> 8) & 0xff; +- unsigned char phy_addr_cd = cec_msg.phy_addr & 0xff; +- cec_dbg_prints("cec_set_stream_path\n"); +- +- if ((hdmi_cec_func_config >> AUTO_POWER_ON_MASK) & 0x1) { +- if ((hdmi_cec_func_config >> STREAMPATH_POWER_ON_MASK) & 0x1) { +- if ((phy_addr_ab == cec_msg.msg[2]) && +- (phy_addr_cd == cec_msg.msg[3])) { +- cec_msg.cec_power = 0x1; +- } ++ unsigned int phy_addr = (cec_msg.msg[2] << 8) | cec_msg.msg[3]; ++ cec_dbg_printx("cec_set_stream_path initiator:0x", initiator, 4); ++ cec_dbg_printx(", phy_addr:0x", phy_addr, 16); ++ cec_dbg_prints("\n"); ++ ++ if ((hdmi_cec_func_config >> STREAMPATH_POWER_ON_MASK) & 0x1) { ++ if (cec_msg.phy_addr == phy_addr && initiator == CEC_TV_ADDR) { ++ cec_msg.cec_power = 0x1; ++ } ++ } ++} ++ ++static void cec_routing_change(unsigned char initiator) ++{ ++ unsigned int phy_addr = (cec_msg.msg[4] << 8) | cec_msg.msg[5]; ++ cec_dbg_printx("cec_routing_change initiator:0x", initiator, 4); ++ cec_dbg_printx(", phy_addr:0x", phy_addr, 16); ++ cec_dbg_prints("\n"); ++ ++ if ((hdmi_cec_func_config >> STREAMPATH_POWER_ON_MASK) & 0x1) { ++ if (cec_msg.phy_addr == phy_addr && initiator == CEC_TV_ADDR) { ++ cec_msg.cec_power = 0x1; + } + } + } +@@ -266,10 +291,14 @@ static void cec_user_control_pressed(void) + cec_dbg_print("cec_user_control_pressed operation:0x", cec_msg.msg[2]); + cec_dbg_prints("\n"); + +- if ((hdmi_cec_func_config >> AUTO_POWER_ON_MASK) & 0x1) { ++ if ((hdmi_cec_func_config >> ONE_TOUCH_STANDBY_MASK) & 0x1) { + if ((0x40 == cec_msg.msg[2]) || // Power + (0x6b == cec_msg.msg[2]) || // Power Toggle Function + (0x6d == cec_msg.msg[2]) || // Power On Function ++ (0x0a == cec_msg.msg[2]) || // Setup Menu ++ (0x0b == cec_msg.msg[2]) || // Contents Menu ++ (0x10 == cec_msg.msg[2]) || // Media Top Menu ++ (0x11 == cec_msg.msg[2]) || // Media Context-sensitive Menu + (0x09 == cec_msg.msg[2])) { // Root Menu + cec_msg.cec_power = 0x1; + } +@@ -290,20 +319,6 @@ static void cec_device_vendor_id(void) + cec_triggle_tx(msg, 5); + } + +-static void cec_menu_status(unsigned char menu_status, unsigned char initiator) +-{ +- unsigned char msg[3]; +- cec_dbg_print("cec_menu_status menu_status:0x", menu_status); +- cec_dbg_printx(", initiator:0x", initiator, 4); +- cec_dbg_prints("\n"); +- +- msg[0] = ((cec_msg.log_addr & 0xf) << 4) | (initiator & 0xf); +- msg[1] = CEC_OC_MENU_STATUS; +- msg[2] = menu_status; +- +- cec_triggle_tx(msg, 3); +-} +- + static void cec_deck_status(unsigned char initiator) + { + unsigned char msg[3]; +@@ -349,7 +364,7 @@ static unsigned int cec_handle_message(void) + unsigned char initiator = (cec_msg.msg[0] >> 4) & 0xf; + unsigned char destination = cec_msg.msg[0] & 0xf; + unsigned char opcode = (cec_msg.msg_len > 1) ? cec_msg.msg[1] : CEC_OC_POLLING_MESSAGE; +- unsigned char directly_addressed = (destination != 0xf && destination == cec_msg.log_addr); ++ unsigned char directly_addressed = (destination != CEC_BROADCAST_ADDR && destination == cec_msg.log_addr); + + cec_dbg_printx("cec_handle_message initiator:0x", initiator, 4); + cec_dbg_printx(", destination:0x", destination, 4); +@@ -380,7 +395,10 @@ static unsigned int cec_handle_message(void) + cec_set_osd_name(initiator); + break; + case CEC_OC_SET_STREAM_PATH: +- cec_set_stream_path(); ++ cec_set_stream_path(initiator); ++ break; ++ case CEC_OC_ROUTING_CHANGE: ++ cec_routing_change(initiator); + break; + case CEC_OC_GIVE_DEVICE_POWER_STATUS: + if (directly_addressed) +@@ -494,16 +512,7 @@ unsigned int cec_handler(void) + void cec_node_init(void) + { + unsigned int phy_addr = readl(P_AO_DEBUG_REG1) & 0xffff; +- unsigned int log_addr = readl(P_AO_DEBUG_REG3) & 0xf; +- if (!log_addr) +- log_addr = 0xf; +- +- cec_dbg_printx("AO_DEBUG_REG0:0x", readl(P_AO_DEBUG_REG0), 32); +- cec_dbg_printx(", AO_DEBUG_REG1:0x", readl(P_AO_DEBUG_REG1), 32); +- cec_dbg_prints("\n"); +- cec_dbg_printx("AO_DEBUG_REG2:0x", readl(P_AO_DEBUG_REG2), 32); +- cec_dbg_printx(", AO_DEBUG_REG3:0x", readl(P_AO_DEBUG_REG3), 32); +- cec_dbg_prints("\n"); ++ unsigned char log_addr = readl(P_AO_DEBUG_REG3) & 0xf; + + cec_dbg_print("cec_node_init cec_config:0x", hdmi_cec_func_config); + cec_dbg_printx(", log_addr:0x", log_addr, 4); +@@ -515,6 +524,12 @@ void cec_node_init(void) + cec_msg.log_addr = log_addr; + cec_msg.phy_addr = phy_addr; + ++ if (!cec_msg.log_addr || !cec_msg.phy_addr) { ++ cec_dbg_prints("WARNING: log/phy_addr is not set, disabling cec wakeup\n"); ++ hdmi_cec_func_config = hdmi_cec_func_config & ~(0x1 << CEC_FUNC_MASK); ++ return; ++ } ++ + cec_wr_reg(CEC_LOGICAL_ADDR0, 0); + cec_hw_buf_clear(); + cec_wr_reg(CEC_LOGICAL_ADDR0, log_addr); +@@ -523,7 +538,6 @@ void cec_node_init(void) + _udelay(100); + + cec_report_physical_address(); +- _udelay(150); + cec_device_vendor_id(); + cec_set_osd_name(CEC_TV_ADDR); + } +diff --git a/arch/arm/cpu/armv8/gxb/firmware/scp_task/suspend.c b/arch/arm/cpu/armv8/gxb/firmware/scp_task/suspend.c +index 8a414da..b16910c 100644 +--- a/arch/arm/cpu/armv8/gxb/firmware/scp_task/suspend.c ++++ b/arch/arm/cpu/armv8/gxb/firmware/scp_task/suspend.c +@@ -73,8 +73,6 @@ void enter_suspend(unsigned int suspend_from) + // FIXME : (1) BLUE LED GPIOAO_13 (2) Current issue 12*mA -> 7*mA + #ifdef CONFIG_CEC_WAKEUP + hdmi_cec_func_config = readl(P_AO_DEBUG_REG0) & 0xff; +- if (!hdmi_cec_func_config) +- hdmi_cec_func_config = 0x2f; // Force cec config until kernel is "fixed" + wait_uart_empty(); + uart_puts("CEC cfg:0x"); + uart_put_hex(hdmi_cec_func_config, 8); From c80df2f000d0b735e9040414a87d53a41d5eb101 Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Mon, 19 Sep 2016 21:52:29 +0200 Subject: [PATCH 2/7] RTL8812AU: update gcc-5 patch --- .../patches/RTL8812AU-03-gcc-5.patch | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/linux-drivers/RTL8812AU/patches/RTL8812AU-03-gcc-5.patch b/packages/linux-drivers/RTL8812AU/patches/RTL8812AU-03-gcc-5.patch index 95466b1b1f..ed84e0226c 100644 --- a/packages/linux-drivers/RTL8812AU/patches/RTL8812AU-03-gcc-5.patch +++ b/packages/linux-drivers/RTL8812AU/patches/RTL8812AU-03-gcc-5.patch @@ -1,7 +1,7 @@ -diff -Naur RTL8812AU-3f015f0/include/ieee80211.h RTL8812AU-3f015f0.patch/include/ieee80211.h ---- RTL8812AU-3f015f0/include/ieee80211.h 2015-07-14 21:45:26.000000000 +0200 -+++ RTL8812AU-3f015f0.patch/include/ieee80211.h 2015-11-03 14:12:38.570076503 +0100 -@@ -1286,12 +1286,12 @@ +diff -Naur a/include/ieee80211.h b/include/ieee80211.h +--- a/include/ieee80211.h ++++ b/include/ieee80211.h +@@ -1388,18 +1388,18 @@ (((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \ (((Addr[5]) & 0xff) == 0xff)) #else @@ -14,5 +14,12 @@ diff -Naur RTL8812AU-3f015f0/include/ieee80211.h RTL8812AU-3f015f0.patch/include -extern __inline int is_broadcast_mac_addr(const u8 *addr) +static __inline int is_broadcast_mac_addr(const u8 *addr) { - return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ - (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); + return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ + (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); + } + +-extern __inline int is_zero_mac_addr(const u8 *addr) ++static __inline int is_zero_mac_addr(const u8 *addr) + { + return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \ + (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00)); From 23037b828804fa47d2e7d29c4f60951c6329a14e Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Mon, 19 Sep 2016 21:52:29 +0200 Subject: [PATCH 3/7] RTL8192EU: add gcc-5 patch --- .../RTL8192EU/patches/RTL8192EU-gcc-5.patch | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 packages/linux-drivers/RTL8192EU/patches/RTL8192EU-gcc-5.patch diff --git a/packages/linux-drivers/RTL8192EU/patches/RTL8192EU-gcc-5.patch b/packages/linux-drivers/RTL8192EU/patches/RTL8192EU-gcc-5.patch new file mode 100644 index 0000000000..06b040858d --- /dev/null +++ b/packages/linux-drivers/RTL8192EU/patches/RTL8192EU-gcc-5.patch @@ -0,0 +1,25 @@ +diff -Naur a/include/ieee80211.h b/include/ieee80211.h +--- a/include/ieee80211.h ++++ b/include/ieee80211.h +@@ -1314,18 +1314,18 @@ + (((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \ + (((Addr[5]) & 0xff) == 0xff)) + #else +-extern __inline int is_multicast_mac_addr(const u8 *addr) ++static __inline int is_multicast_mac_addr(const u8 *addr) + { + return ((addr[0] != 0xff) && (0x01 & addr[0])); + } + +-extern __inline int is_broadcast_mac_addr(const u8 *addr) ++static __inline int is_broadcast_mac_addr(const u8 *addr) + { + return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ + (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); + } + +-extern __inline int is_zero_mac_addr(const u8 *addr) ++static __inline int is_zero_mac_addr(const u8 *addr) + { + return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \ + (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00)); From 73b406c4563da03326f375f858f13b4eee79dfaf Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Mon, 19 Sep 2016 21:52:29 +0200 Subject: [PATCH 4/7] projects/Odroid_C2: switch to linux-amlogic-3.14 This makes Odroid C2 use linux-amlogic and similar linux patches as WeTek Hub u-boot patch updated to allow overwriting env vars boot.ini updated to reflect missing features in linux-amlogic --- packages/linux/package.mk | 2 +- packages/tools/u-boot/scripts/update-c2.sh | 6 +- projects/Odroid_C2/bootloader/boot.ini | 121 +- .../usr/lib/modules-load.d/mali.conf | 1 - .../usr/lib/udev/rules.d/10-odroid.rules | 8 - projects/Odroid_C2/initramfs/platform_init | 101 +- projects/Odroid_C2/linux/linux.aarch64.conf | 177 +- projects/Odroid_C2/options | 7 +- .../libcec/libcec-00-aocec-support.patch | 2 +- ...port-HiFi-Shield-2-sound-card-driver.patch | 1439 -------------- ...io-mods-for-HiFi-Shield1-and-usb-DAC.patch | 1702 ----------------- ...rtl8712_avoid_lots_of_build_warnings.patch | 113 ++ ...5-use_gcc_inline_version_instead_c99.patch | 17 - .../linux/linux-003-no_dev_console.patch | 9 +- .../linux-004-PCM-Audio-add-8CH.feature.patch | 79 - .../linux/linux-006-save-cec-config.patch | 85 - ...ly-working-frequecies-and-bit-depths.patch | 70 +- .../linux/linux-008-max_freq_dvfs_table.patch | 13 +- .../linux-999.13-fix-u64-unknown-type.patch | 12 - ...u-boot-0001-set-default-boot-options.patch | 5 +- projects/WeTek_Hub/linux/linux.aarch64.conf | 3 +- 21 files changed, 388 insertions(+), 3584 deletions(-) delete mode 100644 projects/Odroid_C2/filesystem/usr/lib/modules-load.d/mali.conf delete mode 100644 projects/Odroid_C2/filesystem/usr/lib/udev/rules.d/10-odroid.rules delete mode 100644 projects/Odroid_C2/patches/linux/linux-000-Revert-Odroid-C2-Support-HiFi-Shield-2-sound-card-driver.patch delete mode 100644 projects/Odroid_C2/patches/linux/linux-001-Revert-all-Odroid-custom-audio-mods-for-HiFi-Shield1-and-usb-DAC.patch create mode 100644 projects/Odroid_C2/patches/linux/linux-001-staging_rtl8712_rtl8712_avoid_lots_of_build_warnings.patch delete mode 100644 projects/Odroid_C2/patches/linux/linux-002-gcc5-use_gcc_inline_version_instead_c99.patch delete mode 100644 projects/Odroid_C2/patches/linux/linux-004-PCM-Audio-add-8CH.feature.patch delete mode 100644 projects/Odroid_C2/patches/linux/linux-006-save-cec-config.patch delete mode 100644 projects/Odroid_C2/patches/linux/linux-999.13-fix-u64-unknown-type.patch diff --git a/packages/linux/package.mk b/packages/linux/package.mk index af5d2cba83..b706d452ce 100644 --- a/packages/linux/package.mk +++ b/packages/linux/package.mk @@ -40,7 +40,7 @@ case "$LINUX" in PKG_SOURCE_DIR="$PKG_NAME-amlogic-$PKG_VERSION*" ;; amlogic-3.14) - PKG_VERSION="c733661" + PKG_VERSION="a0d96f4" PKG_URL="https://github.com/LibreELEC/linux-amlogic/archive/$PKG_VERSION.tar.gz" PKG_SOURCE_DIR="$PKG_NAME-amlogic-$PKG_VERSION*" ;; diff --git a/packages/tools/u-boot/scripts/update-c2.sh b/packages/tools/u-boot/scripts/update-c2.sh index 7dde62898c..c063567c0a 100644 --- a/packages/tools/u-boot/scripts/update-c2.sh +++ b/packages/tools/u-boot/scripts/update-c2.sh @@ -55,8 +55,10 @@ dd if=$SYSTEM_ROOT/usr/share/bootloader/u-boot of=$BOOT_DISK conv=fsync bs=1 cou dd if=$SYSTEM_ROOT/usr/share/bootloader/u-boot of=$BOOT_DISK conv=fsync bs=512 skip=1 seek=1 # monkey patch boot.ini for updated kernel - sed -i '/setenv bootcmd "${kernel}; ${dtb}; ${bootseq}"/i \setenv timer "fdt addr 0x1000000; fdt rm /timer"' /flash/boot.ini - sed -i 's|setenv bootcmd "${kernel}; ${dtb}; ${bootseq}"|setenv bootcmd "${kernel}; ${dtb}; ${timer}; ${bootseq}"|' /flash/boot.ini + sed -i 's|setenv odroidp1 "no_console_suspend hdmimode=${video_output} m_bpp=${video_bpp} vout=${video_mode}"|setenv odroidp1 "no_console_suspend logo=${logoopt} vout=${outputmode},enable hdmimode=${hdmimode} cvbsmode=nocvbs"|' /flash/boot.ini + sed -i 's|setenv odroidp2 "${disableuhs} consoleblank=0|setenv odroidp2 "mac=${ethaddr} consoleblank=0|' /flash/boot.ini + sed -i 's|setenv bootcmd "${kernel}; ${dtb}; ${timer}; ${bootseq}"|setenv bootcmd "${kernel}; ${dtb}; ${bootseq}"|' /flash/boot.ini + sed -i 's|setenv bootargs "${console} ${bootrootfs} ${odroid} ${cec} ${hpd} ${dac} ${libreelec}"|setenv bootargs "${console} ${bootrootfs} ${odroid} ${cec} ${libreelec}"|' /flash/boot.ini # mount $BOOT_ROOT r/o sync diff --git a/projects/Odroid_C2/bootloader/boot.ini b/projects/Odroid_C2/bootloader/boot.ini index 1d5516845b..224485b4da 100644 --- a/projects/Odroid_C2/bootloader/boot.ini +++ b/projects/Odroid_C2/bootloader/boot.ini @@ -25,62 +25,44 @@ setenv console "console=tty0" #------------------------------------------------------------------------------------------------------ # # Video -# Setup the video output +# Setup the video output (default is 1080p60hz) # 480 Lines (720x480) -# setenv video_output "480i60hz" # Interlaced 60Hz -# setenv video_output "480i_rpt" # Interlaced for Rear Projection Televisions 60Hz -# setenv video_output "480p60hz" # 480 Progressive 60Hz -# setenv video_output "480p_rpt" # 480 Progressive for Rear Projection Televisions 60Hz +# setenv hdmimode "480i60hz" # Interlaced 60Hz +# setenv hdmimode "480i_rpt" # Interlaced for Rear Projection Televisions 60Hz +# setenv hdmimode "480p60hz" # 480 Progressive 60Hz +# setenv hdmimode "480p_rpt" # 480 Progressive for Rear Projection Televisions 60Hz # 576 Lines (720x576) -# setenv video_output "576i50hz" # Interlaced 50Hz -# setenv video_output "576i_rpt" # Interlaced for Rear Projection Televisions 50Hz -# setenv video_output "576p50hz" # Progressive 50Hz -# setenv video_output "576p_rpt" # Progressive for Rear Projection Televisions 50Hz +# setenv hdmimode "576i50hz" # Interlaced 50Hz +# setenv hdmimode "576i_rpt" # Interlaced for Rear Projection Televisions 50Hz +# setenv hdmimode "576p50hz" # Progressive 50Hz +# setenv hdmimode "576p_rpt" # Progressive for Rear Projection Televisions 50Hz # 720 Lines (1280x720) -# setenv video_output "720p50hz" # Progressive 50Hz -# setenv video_output "720p60hz" # Progressive 60Hz +# setenv hdmimode "720p60hz" # Progressive 60Hz +# setenv hdmimode "720p50hz" # Progressive 50Hz # 1080 Lines (1920x1080) -# setenv video_output "1080i60hz" # Interlaced 60Hz -# setenv video_output "1080p60hz" # Progressive 60Hz -# setenv video_output "1080i50hz" # Interlaced 50Hz -# setenv video_output "1080p50hz" # Progressive 50Hz -# setenv video_output "1080p24hz" # Progressive 24Hz +# setenv hdmimode "1080i60hz" # Interlaced 60Hz +# setenv hdmimode "1080p60hz" # Progressive 60Hz +# setenv hdmimode "1080i50hz" # Interlaced 50Hz +# setenv hdmimode "1080p50hz" # Progressive 50Hz +# setenv hdmimode "1080p30hz" # Progressive 30Hz +# setenv hdmimode "1080p25hz" # Progressive 25Hz +# setenv hdmimode "1080p24hz" # Progressive 24Hz # 4K (3840x2160) -# setenv video_output "2160p30hz" # Progressive 30Hz -# setenv video_output "2160p25hz" # Progressive 25Hz -# setenv video_output "2160p24hz" # Progressive 24Hz -# setenv video_output "smpte24hz" # Progressive 24Hz SMPTE -# setenv video_output "2160p50hz" # Progressive 50Hz -# setenv video_output "2160p60hz" # Progressive 60Hz -# setenv video_output "2160p50hz420" # Progressive 50Hz with YCbCr 4:2:0 (Requires TV/Monitor that supports it) -# setenv video_output "2160p60hz420" # Progressive 60Hz with YCbCr 4:2:0 (Requires TV/Monitor that supports it) -# VESA modes -# setenv video_output "640x480p60hz" -# setenv video_output "800x480p60hz" -# setenv video_output "800x600p60hz" -# setenv video_output "1024x600p60hz" -# setenv video_output "1024x768p60hz" -# setenv video_output "1280x800p60hz" -# setenv video_output "1280x1024p60hz" -# setenv video_output "1360x768p60hz" -# setenv video_output "1366x768p60hz" -# setenv video_output "1440x900p60hz" -# setenv video_output "1600x900p60hz" -# setenv video_output "1680x1050p60hz" -# setenv video_output "1920x1200p60hz" -# -# Setup the HDMI video mode (Must be one or the other) -# setenv video_mode "dvi" # DVI -# setenv video_mode "vga" # VGA -# -# Setup the HDMI BPP Mode -# setenv video_bpp "32" # 32-bit -# setenv video_bpp "24" # 24-bit -# setenv video_bpp "16" # 16-bit -# -# Enable|Disable HDMI Hotplug Detection -# setenv hdmihotplug "0" # Disabled -# setenv hdmihotplug "1" # Enabled +# setenv hdmimode "2160p60hz" # Progressive 60Hz +# setenv hdmimode "2160p50hz" # Progressive 50Hz +# setenv hdmimode "2160p30hz" # Progressive 30Hz +# setenv hdmimode "2160p25hz" # Progressive 25Hz +# setenv hdmimode "2160p24hz" # Progressive 24Hz +# setenv hdmimode "2160p60hz420" # Progressive 60Hz with YCbCr 4:2:0 (Requires TV/Monitor that supports it) +# setenv hdmimode "2160p50hz420" # Progressive 50Hz with YCbCr 4:2:0 (Requires TV/Monitor that supports it) +# 4K2K (4096x2160) +# setenv hdmimode "smpte60hz" # Progressive 60Hz SMPTE +# setenv hdmimode "smpte50hz" # Progressive 50Hz SMPTE +# setenv hdmimode "smpte30hz" # Progressive 30Hz SMPTE +# setenv hdmimode "smpte25hz" # Progressive 25Hz SMPTE +# setenv hdmimode "smpte24hz" # Progressive 24Hz SMPTE +# setenv hdmimode "smpte60hz420" # Progressive 60Hz SMPTE with YCbCr 4:2:0 (Requires TV/Monitor that supports it) +# setenv hdmimode "smpte50hz420" # Progressive 50Hz SMPTE with YCbCr 4:2:0 (Requires TV/Monitor that supports it) # # Enable|Disable HDMI (Saves RAM) # setenv hdmioutput "0" # Disabled @@ -91,10 +73,6 @@ setenv console "console=tty0" # setenv vpu "1" # Enabled # #------------------------------------------------------------------------------------------------------ -setenv video_output "1080p60hz" -setenv video_mode "hdmi" -setenv video_bpp "32" -setenv hdmihotplug "1" setenv hdmioutput "1" setenv vpu "1" @@ -107,15 +85,6 @@ setenv vpu "1" #------------------------------------------------------------------------------------------------------ setenv libreelec "quiet" -#------------------------------------------------------------------------------------------------------ -# -# UHS Card Configuration -# Uncomment the line below to __DISABLE__ UHS-1 MicroSD support -# This might break boot for some brand models of cards. -# -#------------------------------------------------------------------------------------------------------ -# setenv disableuhs "disableuhs" - #------------------------------------------------------------------------------------------------------ # # Enable|Disable HDMI CEC Control @@ -125,17 +94,6 @@ setenv libreelec "quiet" #------------------------------------------------------------------------------------------------------ setenv hdmi_cec "1" -#------------------------------------------------------------------------------------------------------ -# -# PCM5102 I2S Audio DAC (HiFi Shield) -# PCM5102 is an I2S Audio DAC Addon board for ODROID-C1+ -# -# Enable|Disable Audio DAC -# setenv audio_dac "0" # Disabled -# setenv audio_dac "1" # Enabled -#------------------------------------------------------------------------------------------------------ -setenv audio_dac "0" - #------------------------------------------------------------------------------------------------------ # # CPU Frequency / Cores control @@ -167,11 +125,11 @@ setenv max_freq "1536" #------------------------------------------------------------------------------------------------------ # -# Odroid C1 specific +# Odroid C2 specific # #------------------------------------------------------------------------------------------------------ -setenv odroidp1 "no_console_suspend hdmimode=${video_output} m_bpp=${video_bpp} vout=${video_mode}" -setenv odroidp2 "${disableuhs} consoleblank=0 max_freq=${max_freq} maxcpus=${maxcpus}" +setenv odroidp1 "no_console_suspend logo=${logoopt} vout=${outputmode},enable hdmimode=${hdmimode} cvbsmode=nocvbs" +setenv odroidp2 "mac=${ethaddr} consoleblank=0 max_freq=${max_freq} maxcpus=${maxcpus}" setenv odroid "${odroidp1} ${odroidp2}" #------------------------------------------------------------------------------------------------------ @@ -182,8 +140,7 @@ setenv odroid "${odroidp1} ${odroidp2}" setenv kernel "fatload mmc 0:1 0x11000000 KERNEL" setenv dtb "fatload mmc 0:1 0x1000000 meson64_odroidc2.dtb" setenv bootseq "booti 0x11000000 - 0x1000000" -setenv timer "fdt addr 0x1000000; fdt rm /timer" -setenv bootcmd "${kernel}; ${dtb}; ${timer}; ${bootseq}" +setenv bootcmd "${kernel}; ${dtb}; ${bootseq}" #------------------------------------------------------------------------------------------------------ # @@ -193,13 +150,11 @@ setenv bootcmd "${kernel}; ${dtb}; ${timer}; ${bootseq}" # Prepare to boot if test "${hdmi_cec}" = "1"; then setenv cec "hdmitx=cec17"; fi -if test "${hdmi_hotplug}" = "0"; then setenv hpd "disablehpd=true"; fi -if test "${audio_dac}" = "1"; then setenv dac "enabledac"; fi if test "${vpu}" = "0"; then fdt rm /mesonstream; fdt rm /vdec; fdt rm /ppmgr; fi if test "${hdmioutput}" = "0"; then fdt rm /mesonfb; fi # Populate the final bootcmd -setenv bootargs "${console} ${bootrootfs} ${odroid} ${cec} ${hpd} ${dac} ${libreelec}" +setenv bootargs "${console} ${bootrootfs} ${odroid} ${cec} ${libreelec}" # Boot the board run bootcmd diff --git a/projects/Odroid_C2/filesystem/usr/lib/modules-load.d/mali.conf b/projects/Odroid_C2/filesystem/usr/lib/modules-load.d/mali.conf deleted file mode 100644 index 29c66fc8c8..0000000000 --- a/projects/Odroid_C2/filesystem/usr/lib/modules-load.d/mali.conf +++ /dev/null @@ -1 +0,0 @@ -mali diff --git a/projects/Odroid_C2/filesystem/usr/lib/udev/rules.d/10-odroid.rules b/projects/Odroid_C2/filesystem/usr/lib/udev/rules.d/10-odroid.rules deleted file mode 100644 index 3f927bf6e0..0000000000 --- a/projects/Odroid_C2/filesystem/usr/lib/udev/rules.d/10-odroid.rules +++ /dev/null @@ -1,8 +0,0 @@ -KERNEL=="mali",SUBSYSTEM=="misc",MODE="0777" -KERNEL=="mali0",SUBSYSTEM=="misc",MODE="0777" -KERNEL=="ump",SUBSYSTEM=="ump",MODE="0777" -KERNEL=="ttySAC0", SYMLINK+="ttyACM99" -KERNEL=="event*", SUBSYSTEM=="input", MODE="0777" -KERNEL=="CEC", MODE="0777" -KERNEL=="amvideo", MODE="0666" -KERNEL=="amstream*", MODE="0666" diff --git a/projects/Odroid_C2/initramfs/platform_init b/projects/Odroid_C2/initramfs/platform_init index b529283cc1..d99783f0ba 100644 --- a/projects/Odroid_C2/initramfs/platform_init +++ b/projects/Odroid_C2/initramfs/platform_init @@ -1,50 +1,69 @@ #!/bin/sh +################################################################################ +# This file is part of LibreELEC - https://LibreELEC.tv +# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv) +# Copyright (C) 2016 Team LibreELEC +# +# LibreELEC is free software: 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. +# +# LibreELEC 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 LibreELEC. If not, see . +################################################################################ -for x in $(cat /proc/cmdline); do - case ${x} in - m_bpp=*) export bpp=${x#*=} ;; - hdmimode=*) export mode=${x#*=} ;; +hdmimode=1080p60hz + +# Parse command line arguments +for arg in $(cat /proc/cmdline); do + case $arg in + hdmimode=*) + hdmimode="${arg#*=}" + ;; esac done -common_display_setup() { - M="0 0 $(($X - 1)) $(($Y - 1))" - Y_VIRT=$(($Y * 2)) - fbset -fb /dev/fb0 -g $X $Y $X $Y_VIRT $bpp - fbset -fb /dev/fb1 -g 32 32 32 32 32 - echo $mode > /sys/class/display/mode - echo 0 > /sys/class/graphics/fb0/free_scale - echo 1 > /sys/class/graphics/fb0/freescale_mode - echo $M > /sys/class/graphics/fb0/free_scale_axis - echo $M > /sys/class/graphics/fb0/window_axis - echo 0 > /sys/class/graphics/fb1/free_scale - echo 1 > /sys/class/video/disable_video -} +# Enable first framebuffer +echo 0 > /sys/class/graphics/fb0/blank -case $mode in - 480*) export X=720 Y=480 ;; - 576*) export X=720 Y=576 ;; - 720p*) export X=1280 Y=720 ;; - 1080*) export X=1920 Y=1080 ;; - 2160p*) export X=3840 Y=2160 ;; - smpte24hz*) export X=3840 Y=2160 ;; - 640x480p60hz*) export X=640 Y=480 ;; - 800x480p60hz*) export X=800 Y=480 ;; - 800x600p60hz*) export X=800 Y=600 ;; - 1024x600p60hz*) export X=1024 Y=600 ;; - 1024x768p60hz*) export X=1024 Y=768 ;; - 1280x800p60hz*) export X=1280 Y=800 ;; - 1280x1024p60hz*) export X=1280 Y=1024 ;; - 1360x768p60hz*) export X=1360 Y=768 ;; - 1366x768p60hz*) export X=1366 Y=768 ;; - 1440x900p60hz*) export X=1440 Y=900 ;; - 1600x900p60hz*) export X=1600 Y=900 ;; - 1680x1050p60hz*) export X=1680 Y=1050 ;; - 1920x1200p60hz*) export X=1920 Y=1200 ;; +# Disable second framebuffer +echo 1 > /sys/class/graphics/fb1/blank + +# Disable framebuffer scaling +echo 0 > /sys/class/graphics/fb0/free_scale +echo 0 > /sys/class/graphics/fb1/free_scale + +# set initial video state +echo 1 > /sys/class/video/disable_video + +# Set framebuffer geometry to match the resolution +case $hdmimode in + 480*) X=720 Y=480 ;; + 576*) X=720 Y=576 ;; + 720p*) X=1280 Y=720 ;; + *) X=1920 Y=1080 ;; esac -common_display_setup +fbset -fb /dev/fb0 -g $X $Y 1920 2160 32 +fbset -fb /dev/fb1 -g 32 32 32 32 32 -# Console unblack -echo 0 > /sys/class/graphics/fb0/blank -echo 0 > /sys/class/graphics/fb1/blank +# Enable scaling for 4K output +case $hdmimode in + 4k*|smpte*|2160*) + echo 0 0 1919 1079 > /sys/class/graphics/fb0/free_scale_axis + echo 0 0 3839 2159 > /sys/class/graphics/fb0/window_axis + echo 1920 > /sys/class/graphics/fb0/scale_width + echo 1080 > /sys/class/graphics/fb0/scale_height + echo 0x10001 > /sys/class/graphics/fb0/free_scale + ;; +esac + +# Include deinterlacer into default VFM map +echo rm default > /sys/class/vfm/map +echo add default decoder ppmgr deinterlace amvideo > /sys/class/vfm/map diff --git a/projects/Odroid_C2/linux/linux.aarch64.conf b/projects/Odroid_C2/linux/linux.aarch64.conf index e9ef18f652..aa6a146a2b 100644 --- a/projects/Odroid_C2/linux/linux.aarch64.conf +++ b/projects/Odroid_C2/linux/linux.aarch64.conf @@ -1,15 +1,18 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm64 3.14.79 Kernel Configuration +# Linux/arm64 3.14.29 Kernel Configuration # CONFIG_ARM64=y CONFIG_ARM64_HAS_SG_CHAIN=y CONFIG_64BIT=y CONFIG_ARCH_PHYS_ADDR_T_64BIT=y CONFIG_MMU=y +CONFIG_ARCH_MMAP_RND_BITS_MIN=18 +CONFIG_ARCH_MMAP_RND_BITS_MAX=18 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 CONFIG_NO_IOPORT=y CONFIG_STACKTRACE_SUPPORT=y -CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 CONFIG_LOCKDEP_SUPPORT=y CONFIG_TRACE_IRQFLAGS_SUPPORT=y CONFIG_RWSEM_GENERIC_SPINLOCK=y @@ -36,7 +39,7 @@ CONFIG_CROSS_COMPILE="" CONFIG_LOCALVERSION="" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_DEFAULT_HOSTNAME="@DISTRONAME@" -# CONFIG_SWAP is not set +CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y CONFIG_POSIX_MQUEUE=y @@ -123,7 +126,7 @@ CONFIG_IPC_NS=y CONFIG_USER_NS=y CONFIG_PID_NS=y CONFIG_NET_NS=y -CONFIG_SCHED_AUTOGROUP=y +# CONFIG_SCHED_AUTOGROUP is not set # CONFIG_SYSFS_DEPRECATED is not set # CONFIG_RELAY is not set CONFIG_BLK_DEV_INITRD=y @@ -203,6 +206,11 @@ CONFIG_HAVE_CONTEXT_TRACKING=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y CONFIG_MODULES_USE_ELF_RELA=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_HAVE_ARCH_MMAP_RND_BITS=y +CONFIG_ARCH_MMAP_RND_BITS=18 +CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y +CONFIG_ARCH_MMAP_RND_COMPAT_BITS=11 CONFIG_CLONE_BACKWARDS=y CONFIG_OLD_SIGSUSPEND3=y CONFIG_COMPAT_OLD_SIGACTION=y @@ -211,7 +219,6 @@ CONFIG_COMPAT_OLD_SIGACTION=y # GCOV-based kernel profiling # # CONFIG_GCOV_KERNEL is not set -CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y CONFIG_HAVE_GENERIC_DMA_COHERENT=y CONFIG_SLABINFO=y CONFIG_RT_MUTEXES=y @@ -268,19 +275,27 @@ CONFIG_ARCH_MESON64_ODROIDC2=y CONFIG_ARM_AMBA=y # -# Kernel Features +# ARM errata workarounds via the alternatives framework # +CONFIG_ARM64_ERRATUM_845719=y +CONFIG_ARM64_ERRATUM_843419=y +CONFIG_ARM64_ERRATUM_835769=y # -# ARM errata workarounds +# Kernel Features # -# CONFIG_ARM64_ERRATUM_845719 is not set # CONFIG_ARM64_64K_PAGES is not set # CONFIG_CPU_BIG_ENDIAN is not set CONFIG_SMP=y CONFIG_SCHED_MC=y -CONFIG_SCHED_SMT=y +# CONFIG_SCHED_SMT is not set # CONFIG_DISABLE_CPU_SCHED_DOMAIN_BALANCE is not set +CONFIG_SCHED_HMP=y +# CONFIG_SCHED_HMP_PRIO_FILTER is not set +CONFIG_HMP_FAST_CPU_MASK="" +CONFIG_HMP_SLOW_CPU_MASK="" +# CONFIG_HMP_VARIABLE_SCALE is not set +# CONFIG_SCHED_HMP_LITTLE_PACKING is not set CONFIG_NR_CPUS=4 CONFIG_HOTPLUG_CPU=y CONFIG_SWP_EMULATE=y @@ -300,7 +315,6 @@ CONFIG_ARMV7_COMPAT_CPUINFO=y CONFIG_SYS_SUPPORTS_HUGETLBFS=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y -CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_SELECT_MEMORY_MODEL=y CONFIG_SPARSEMEM_MANUAL=y CONFIG_SPARSEMEM=y @@ -329,6 +343,8 @@ CONFIG_CMA_AREAS=7 # CONFIG_ZBUD is not set # CONFIG_ZSMALLOC is not set CONFIG_GENERIC_EARLY_IOREMAP=y +# CONFIG_KEXEC is not set +# CONFIG_CRASH_DUMP is not set # CONFIG_XEN is not set CONFIG_FORCE_MAX_ZONEORDER=11 CONFIG_SECCOMP=y @@ -341,7 +357,6 @@ CONFIG_CMDLINE_FROM_BOOTLOADER=y # CONFIG_CMDLINE_EXTEND is not set # CONFIG_CMDLINE_FORCE is not set # CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE is not set -# CONFIG_EFI is not set # # Userspace binary formats @@ -402,11 +417,17 @@ CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y CONFIG_CPU_FREQ_GOV_PERFORMANCE=y # CONFIG_CPU_FREQ_GOV_POWERSAVE is not set # CONFIG_CPU_FREQ_GOV_USERSPACE is not set -# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set +CONFIG_CPU_FREQ_GOV_ONDEMAND=y CONFIG_CPU_FREQ_GOV_HOTPLUG=y -# CONFIG_CPU_FREQ_GOV_INTERACTIVE is not set -# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set +CONFIG_CPU_FREQ_GOV_INTERACTIVE=y +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y # CONFIG_GENERIC_CPUFREQ_CPU0 is not set + +# +# ARM CPU frequency scaling drivers +# +# CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set +# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARM64_CPU_SUSPEND=y @@ -420,7 +441,6 @@ CONFIG_ARM64_CPU_SUSPEND=y # # CONFIG_CPU_IDLE is not set # CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set -# CONFIG_ARM64_ERRATUM_843419 is not set CONFIG_NET=y CONFIG_COMPAT_NETLINK_MESSAGES=y @@ -779,14 +799,12 @@ CONFIG_MAC80211_LEDS=y # # Amlogic Device Drivers # - -# -# AO CEC Support -# -CONFIG_AML_AO_CEC=y CONFIG_MESON_TIMER=y +# CONFIG_MESON_LOCAL_TIMER is not set +CONFIG_MESON_BC_TIMER=y CONFIG_AM_UART=y CONFIG_SERIAL_MESON_CONSOLE=y +# CONFIG_PRINTK_NOBLOCK_MODE is not set CONFIG_AML_CPU_VERSION=y CONFIG_AML_MESON64_VERSION=y # CONFIG_AML_M8_VERSION is not set @@ -804,8 +822,10 @@ CONFIG_USB_HOST_ELECT_TEST=y # I2C Hardware Bus support # CONFIG_I2C_AML=y +# CONFIG_I2C_SLAVE_AML is not set # CONFIG_I2C_SW_AML is not set # CONFIG_BCM2079X_I2C is not set +# CONFIG_AML_PWM is not set # # HDMI TX Support @@ -824,6 +844,7 @@ CONFIG_AML_REG_ACCESS=y # # CONFIG_AML_POWER_SUPPORT is not set # CONFIG_AML_PMU_ALGORITHM_SUPPORT is not set +# CONFIG_AML_PMU4 is not set # # Ethernet Support @@ -878,7 +899,6 @@ CONFIG_AM_VOUT=y CONFIG_AM_TV_OUTPUT=y CONFIG_AML_VOUT_FRAMERATE_AUTOMATION=y # CONFIG_AML_VDAC_HW_SWITCH is not set -# CONFIG_AM_LCD_OUTPUT is not set # # Amlogic OSD Module @@ -902,10 +922,15 @@ CONFIG_FB_OSD2_CURSOR=y CONFIG_AM_GE2D=y CONFIG_AM_LOGO=y +# +# Amlogic LCD Output Module +# +# CONFIG_AML_LCD is not set + # # Amlogic Backlight Support # -# CONFIG_AMLOGIC_BACKLIGHT is not set +# CONFIG_AML_BACKLIGHT is not set # CONFIG_AMLOGIC_LED is not set # @@ -914,6 +939,7 @@ CONFIG_AM_LOGO=y CONFIG_AML_CANVAS=y CONFIG_AMLOGIC_CLK=y CONFIG_AMLOGIC_SEC=y +# CONFIG_AML_SERR is not set CONFIG_AMLOGIC_SECURITY_KEY=y CONFIG_AM_PTSSERVER=y # CONFIG_H264_4K2K_SINGLE_CORE is not set @@ -934,6 +960,7 @@ CONFIG_AM_VDEC_H264=y CONFIG_AM_VDEC_H264MVC=y CONFIG_AM_VDEC_H264_4K2K=y CONFIG_AM_VDEC_H265=y +CONFIG_AM_VDEC_VP9=y CONFIG_AM_VDEC_MJPEG=y CONFIG_AM_ENCODER=y CONFIG_AM_JPEG_ENCODER=y @@ -945,6 +972,7 @@ CONFIG_AM_TIMESYNC=y CONFIG_AM_STREAMING=y CONFIG_AM_SUBTITLE=y # CONFIG_AM_VIDEOCAPTURE is not set +# CONFIG_AM_HEVCENC is not set # # Deinterlace driver @@ -984,7 +1012,7 @@ CONFIG_AML_AUDIO_DSP=y # CONFIG_POST_PROCESS_MANAGER=y CONFIG_POST_PROCESS_MANAGER_PPSCALER=y -# CONFIG_POST_PROCESS_MANAGER_3D_PROCESS is not set +CONFIG_POST_PROCESS_MANAGER_3D_PROCESS=y # # Amlogic Wifi Driver @@ -997,6 +1025,7 @@ CONFIG_GXBB_POWER_RESET=y # # Amlogic Bt Rfkill Driver # +# CONFIG_BLUESLEEP is not set # # Amlogic ion video support @@ -1013,7 +1042,14 @@ CONFIG_V4L_AMLOGIC_VIDEO=y # # Amlogic TVIN Drivers # -# CONFIG_TVIN is not set +CONFIG_TVIN=y +# CONFIG_TVIN_VDIN is not set +# CONFIG_TVIN_AFE is not set +CONFIG_TVIN_HDMI=y +# CONFIG_TVIN_HDMI_CEC is not set +# CONFIG_TVIN_BT656 is not set +# CONFIG_VIUIN is not set +# CONFIG_TVIN_ISP is not set # # Amlogic VECM Drivers @@ -1036,6 +1072,7 @@ CONFIG_MESON_INPUT_KEYBOARD=y CONFIG_ADC_KEYPADS_AM=y CONFIG_AML_GPIO_KEY=y # CONFIG_SENSOR_DEVICES is not set +# CONFIG_AMLOGIC_AVIN_DETECT is not set # CONFIG_AMLOGIC_MESON_CPUFREQ is not set CONFIG_AMLOGIC_SCPI_CPUFREQ=y CONFIG_MESON_SUSPEND=y @@ -1053,6 +1090,7 @@ CONFIG_GXBB_SUSPEND=y # # CONFIG_AM_PCMCIA is not set # CONFIG_AM_IOBUS is not set +# CONFIG_AML_SMARTCARD is not set # # MESON MHU mailbox Support @@ -1068,7 +1106,7 @@ CONFIG_AML_RDMA=y # # Amlogic temperature sensor # -# CONFIG_AML_TEMP_SENSOR is not set +CONFIG_AML_TEMP_SENSOR=y CONFIG_AUDIO_DATA=y # CONFIG_INSTABOOT is not set @@ -1078,8 +1116,29 @@ CONFIG_AUDIO_DATA=y # CONFIG_VIDEO_AMLOGIC_CAPTURE is not set CONFIG_AML_CODEC_MM=y # CONFIG_AML_WDT is not set -CONFIG_MESON_PWM=y -CONFIG_MESON_PWM_CTRL=y + +# +# AMLOGIC SPI Hardware bus support +# +# CONFIG_AMLOGIC_SPICC_MASTER is not set +# CONFIG_AMLOGIC_JTAG is not set +CONFIG_AMLOGIC_CPU_INFO=y + +# +# defend img file update support +# +# CONFIG_DEFEND_IMG is not set + +# +# AO CEC Support +# +CONFIG_AML_AO_CEC=y + +# +# Amlogic Crypto Support +# +# CONFIG_CRYPTO_AML is not set +# CONFIG_AMLOGIC_WATCHPOINT is not set # # Generic Driver Options @@ -1214,7 +1273,8 @@ CONFIG_OF=y # # Device Tree and Open Firmware support # -# CONFIG_OF_UNITTEST is not set +CONFIG_PROC_DEVICETREE=y +# CONFIG_OF_SELFTEST is not set CONFIG_OF_FLATTREE=y CONFIG_OF_EARLY_FLATTREE=y CONFIG_OF_ADDRESS=y @@ -1403,6 +1463,7 @@ CONFIG_NET_VENDOR_WIZNET=y # # MII PHY device drivers # +# CONFIG_AMLOGIC_PHY is not set # CONFIG_AT803X_PHY is not set # CONFIG_AMD_PHY is not set # CONFIG_MARVELL_PHY is not set @@ -1548,13 +1609,12 @@ CONFIG_RT2X00_LIB_FIRMWARE=y CONFIG_RT2X00_LIB_CRYPTO=y CONFIG_RT2X00_LIB_LEDS=y # CONFIG_RT2X00_DEBUG is not set +# CONFIG_RTL_CARDS is not set # CONFIG_WL_TI is not set CONFIG_ZD1211RW=m # CONFIG_ZD1211RW_DEBUG is not set # CONFIG_MWIFIEX is not set # CONFIG_CW1200 is not set -# CONFIG_RTL8821AU is not set -# CONFIG_RTL8192CU is not set # # Enable WiMAX (Networking options) to see the WiMAX drivers @@ -1657,8 +1717,7 @@ CONFIG_HW_CONSOLE=y CONFIG_VT_HW_CONSOLE_BINDING=y CONFIG_UNIX98_PTYS=y # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set -CONFIG_LEGACY_PTYS=y -CONFIG_LEGACY_PTY_COUNT=256 +# CONFIG_LEGACY_PTYS is not set # CONFIG_SERIAL_NONSTANDARD is not set # CONFIG_N_GSM is not set # CONFIG_TRACE_SINK is not set @@ -1687,6 +1746,7 @@ CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_SERIAL_XILINX_PS_UART is not set # CONFIG_SERIAL_ARC is not set # CONFIG_SERIAL_FSL_LPUART is not set +# CONFIG_SUPPORT_SYSRQ is not set CONFIG_TTY_PRINTK=y # CONFIG_IPMI_HANDLER is not set CONFIG_HW_RANDOM=y @@ -2196,7 +2256,6 @@ CONFIG_IR_IGUANA=m CONFIG_IR_TTUSBIR=m # CONFIG_RC_LOOPBACK is not set CONFIG_IR_GPIO_CIR=m -CONFIG_IR_GPIOPLUG_CIR=m CONFIG_MEDIA_USB_SUPPORT=y # @@ -2591,21 +2650,6 @@ CONFIG_FRAMEBUFFER_CONSOLE=m # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set # CONFIG_LOGO is not set # CONFIG_FB_SSD1307 is not set -CONFIG_MALI400=y -CONFIG_MALI450=y -# CONFIG_MALI470 is not set -# CONFIG_MALI400_DEBUG is not set -# CONFIG_MALI400_PROFILING is not set -CONFIG_MALI400_UMP=y -# CONFIG_MALI_DVFS is not set -CONFIG_MALI_DMA_BUF_MAP_ON_ATTACH=y -# CONFIG_MALI_SHARED_INTERRUPTS is not set -# CONFIG_MALI_PMU_PARALLEL_POWER_UP is not set -CONFIG_MALI_DT=y -# CONFIG_MALI_QUIET is not set -CONFIG_UMP=y -# CONFIG_UMP_DEBUG is not set -# CONFIG_FB_TFT is not set CONFIG_SOUND=y # CONFIG_SOUND_OSS_CORE is not set CONFIG_SND=y @@ -2649,10 +2693,16 @@ CONFIG_SND_SOC=y # CONFIG_SND_DESIGNWARE_I2S is not set CONFIG_SND_AML_M8_SOC=y CONFIG_SND_AML_M8=y -# CONFIG_SND_AML_G9TV is not set +CONFIG_SND_AML_SPLIT_MODE=y +# CONFIG_SND_AML_SPLIT_MODE_MMAP is not set CONFIG_SND_SOC_I2C_AND_SPI=y CONFIG_SND_SOC_DUMMY_CODEC=y +CONFIG_SND_SOC_TAS5707=y +CONFIG_SND_SOC_TAS5717=y +CONFIG_SND_SOC_TAS5731=y CONFIG_SND_SOC_PCM2BT=y +CONFIG_SND_SOC_AMLT9015=y +CONFIG_SND_SOC_AMLT9015S=y # CONFIG_SND_SIMPLE_CARD is not set # CONFIG_SOUND_PRIME is not set @@ -2676,6 +2726,7 @@ CONFIG_HID_AUREAL=y CONFIG_HID_BELKIN=y CONFIG_HID_CHERRY=y CONFIG_HID_CHICONY=y +# CONFIG_HID_DIA_REMOTE is not set # CONFIG_HID_PRODIKEYS is not set CONFIG_HID_CYPRESS=y CONFIG_HID_DRAGONRISE=m @@ -2931,6 +2982,9 @@ CONFIG_USB_PHY=y CONFIG_USB_ISP1301=y # CONFIG_USB_RCAR_PHY is not set CONFIG_USB_ULPI=y +# CONFIG_AMLOGIC_USBPHY is not set +# CONFIG_AMLOGIC_USB2PHY is not set +# CONFIG_AMLOGIC_USB3PHY is not set CONFIG_USB_GADGET=y # CONFIG_USB_GADGET_DEBUG is not set # CONFIG_USB_GADGET_DEBUG_FILES is not set @@ -3181,14 +3235,11 @@ CONFIG_DVB_AS102=m # Android # CONFIG_ANDROID=y -CONFIG_ANDROID_BINDER_IPC=y -# CONFIG_ANDROID_BINDER_IPC_32BIT is not set -CONFIG_ASHMEM=y -CONFIG_ANDROID_LOGGER=y -CONFIG_ANDROID_TIMED_OUTPUT=y -# CONFIG_ANDROID_TIMED_GPIO is not set -CONFIG_ANDROID_LOW_MEMORY_KILLER=y -CONFIG_ANDROID_LOW_MEMORY_KILLER_AUTODETECT_OOM_ADJ_VALUES=y +# CONFIG_ANDROID_BINDER_IPC is not set +# CONFIG_ASHMEM is not set +# CONFIG_ANDROID_LOGGER is not set +# CONFIG_ANDROID_TIMED_OUTPUT is not set +# CONFIG_ANDROID_LOW_MEMORY_KILLER is not set # CONFIG_ANDROID_INTF_ALARM_DEV is not set CONFIG_SYNC=y CONFIG_SW_SYNC=y @@ -3262,11 +3313,7 @@ CONFIG_RESET_CONTROLLER=y # CONFIG_PHY_EXYNOS_MIPI_VIDEO is not set # CONFIG_PHY_EXYNOS_DP_VIDEO is not set # CONFIG_POWERCAP is not set - -# -# Firmware Drivers -# -# CONFIG_FIRMWARE_MEMMAP is not set +# CONFIG_CORESIGHT is not set # # File systems @@ -3311,7 +3358,6 @@ CONFIG_QUOTACTL=y CONFIG_AUTOFS4_FS=m CONFIG_FUSE_FS=m # CONFIG_CUSE is not set -# CONFIG_OVERLAY_FS is not set # # Caches @@ -3335,6 +3381,7 @@ CONFIG_FAT_FS=y CONFIG_VFAT_FS=y CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_FAT_DEFAULT_IOCHARSET="ascii" +# CONFIG_EXFAT_FS is not set # CONFIG_NTFS_FS is not set # @@ -3391,7 +3438,6 @@ CONFIG_F2FS_FS=y CONFIG_F2FS_STAT_FS=y # CONFIG_F2FS_FS_XATTR is not set # CONFIG_F2FS_CHECK_FS is not set -# CONFIG_AUFS_FS is not set CONFIG_NETWORK_FILESYSTEMS=y CONFIG_NFS_FS=y CONFIG_NFS_V2=y @@ -3501,7 +3547,7 @@ CONFIG_DEBUG_INFO=y # CONFIG_DEBUG_INFO_REDUCED is not set CONFIG_ENABLE_WARN_DEPRECATED=y CONFIG_ENABLE_MUST_CHECK=y -CONFIG_FRAME_WARN=1024 +CONFIG_FRAME_WARN=2048 # CONFIG_STRIP_ASM_SYMS is not set # CONFIG_READABLE_ASM is not set # CONFIG_UNUSED_SYMBOLS is not set @@ -3629,6 +3675,7 @@ CONFIG_FTRACE_MCOUNT_RECORD=y # CONFIG_DMA_API_DEBUG is not set # CONFIG_TEST_MODULE is not set # CONFIG_TEST_USER_COPY is not set +# CONFIG_CHECK_ISR_TIME is not set # CONFIG_SAMPLES is not set CONFIG_HAVE_ARCH_KGDB=y # CONFIG_KGDB is not set diff --git a/projects/Odroid_C2/options b/projects/Odroid_C2/options index 9edaf70d71..010da61e85 100644 --- a/projects/Odroid_C2/options +++ b/projects/Odroid_C2/options @@ -45,7 +45,7 @@ # Kernel to use. values can be: # default: default mainline kernel - LINUX="hardkernel" + LINUX="amlogic-3.14" ################################################################################ # setup build defaults @@ -97,7 +97,7 @@ # for a list of additinoal drivers see packages/linux-drivers # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2" - ADDITIONAL_DRIVERS="RTL8192CU RTL8192DU RTL8188EU RTL8192EU RTL8812AU" + ADDITIONAL_DRIVERS="gpu-aml RTL8192CU RTL8192DU RTL8188EU RTL8192EU RTL8812AU" # additional Firmware to use (dvb-firmware, misc-firmware, wlan-firmware) # Space separated list is supported, @@ -113,9 +113,6 @@ # Amlogic IR remote support (yes / no) AMREMOTE_SUPPORT="no" - # Odroid IR remote support (yes / no) - ODROIDREMOTE_SUPPORT="yes" - # build with swap support (yes / no) SWAP_SUPPORT="no" diff --git a/projects/Odroid_C2/patches/libcec/libcec-00-aocec-support.patch b/projects/Odroid_C2/patches/libcec/libcec-00-aocec-support.patch index 00f67c5133..b3cd656c99 100644 --- a/projects/Odroid_C2/patches/libcec/libcec-00-aocec-support.patch +++ b/projects/Odroid_C2/patches/libcec/libcec-00-aocec-support.patch @@ -25,7 +25,7 @@ index 0fdd48e..881a805 100644 /*! + * the path to use for the AOCEC HDMI CEC device + */ -+#define CEC_AOCEC_PATH "/dev/cec" ++#define CEC_AOCEC_PATH "/dev/aocec" + +/*! + * the name of the virtual COM port to use for the AOCEC' CEC wire diff --git a/projects/Odroid_C2/patches/linux/linux-000-Revert-Odroid-C2-Support-HiFi-Shield-2-sound-card-driver.patch b/projects/Odroid_C2/patches/linux/linux-000-Revert-Odroid-C2-Support-HiFi-Shield-2-sound-card-driver.patch deleted file mode 100644 index f0cd741880..0000000000 --- a/projects/Odroid_C2/patches/linux/linux-000-Revert-Odroid-C2-Support-HiFi-Shield-2-sound-card-driver.patch +++ /dev/null @@ -1,1439 +0,0 @@ -From 37a2854ffecfec548156a7fb8b2b43467f452abd Mon Sep 17 00:00:00 2001 -From: Jamie Coldhill -Date: Mon, 19 Sep 2016 12:44:56 +0800 -Subject: [PATCH] Revert "odroid-c2:Support HiFi-Shield-2 sound card driver." - -This reverts commit 5bcf1b74aac7ec16eb5bc78f34c6b4ec3fbe7a9e. ---- - .../devicetree/bindings/sound/pcm512x.txt | 52 -- - arch/arm64/boot/dts/meson64_odroidc2.dts | 8 - - arch/arm64/configs/odroidc2_defconfig | 6 +- - sound/soc/aml/m8/Kconfig | 5 - - sound/soc/aml/m8/Makefile | 2 - - sound/soc/aml/m8/odroid_dac2.c | 217 -------- - sound/soc/aml/m8/odroid_dac2.h | 31 -- - sound/soc/codecs/Kconfig | 17 - - sound/soc/codecs/Makefile | 6 - - sound/soc/codecs/pcm512x-i2c.c | 81 --- - sound/soc/codecs/pcm512x-spi.c | 72 --- - sound/soc/codecs/pcm512x.c | 609 --------------------- - sound/soc/codecs/pcm512x.h | 171 ------ - 13 files changed, 1 insertion(+), 1276 deletions(-) - delete mode 100644 Documentation/devicetree/bindings/sound/pcm512x.txt - delete mode 100644 sound/soc/aml/m8/odroid_dac2.c - delete mode 100644 sound/soc/aml/m8/odroid_dac2.h - delete mode 100644 sound/soc/codecs/pcm512x-i2c.c - delete mode 100644 sound/soc/codecs/pcm512x-spi.c - delete mode 100644 sound/soc/codecs/pcm512x.c - delete mode 100644 sound/soc/codecs/pcm512x.h - -diff --git a/Documentation/devicetree/bindings/sound/pcm512x.txt b/Documentation/devicetree/bindings/sound/pcm512x.txt -deleted file mode 100644 -index 3aae3b4..0000000 ---- a/Documentation/devicetree/bindings/sound/pcm512x.txt -+++ /dev/null -@@ -1,52 +0,0 @@ --PCM512x audio CODECs -- --These devices support both I2C and SPI (configured with pin strapping --on the board). -- --Required properties: -- -- - compatible : One of "ti,pcm5121", "ti,pcm5122", "ti,pcm5141" or -- "ti,pcm5142" -- -- - reg : the I2C address of the device for I2C, the chip select -- number for SPI. -- -- - AVDD-supply, DVDD-supply, and CPVDD-supply : power supplies for the -- device, as covered in bindings/regulator/regulator.txt -- --Optional properties: -- -- - clocks : A clock specifier for the clock connected as SCLK. If this -- is absent the device will be configured to clock from BCLK. If pll-in -- and pll-out are specified in addition to a clock, the device is -- configured to accept clock input on a specified gpio pin. -- -- - pll-in, pll-out : gpio pins used to connect the pll using <1> -- through <6>. The device will be configured for clock input on the -- given pll-in pin and PLL output on the given pll-out pin. An -- external connection from the pll-out pin to the SCLK pin is assumed. -- --Examples: -- -- pcm5122: pcm5122@4c { -- compatible = "ti,pcm5122"; -- reg = <0x4c>; -- -- AVDD-supply = <®_3v3_analog>; -- DVDD-supply = <®_1v8>; -- CPVDD-supply = <®_3v3>; -- }; -- -- -- pcm5142: pcm5142@4c { -- compatible = "ti,pcm5142"; -- reg = <0x4c>; -- -- AVDD-supply = <®_3v3_analog>; -- DVDD-supply = <®_1v8>; -- CPVDD-supply = <®_3v3>; -- -- clocks = <&sck>; -- pll-in = <3>; -- pll-out = <6>; -- }; -diff --git a/arch/arm64/boot/dts/meson64_odroidc2.dts b/arch/arm64/boot/dts/meson64_odroidc2.dts -index 48310c9..5f64ee3 100755 ---- a/arch/arm64/boot/dts/meson64_odroidc2.dts -+++ b/arch/arm64/boot/dts/meson64_odroidc2.dts -@@ -647,14 +647,6 @@ - sound-dai = <&pcm5102_codec>; - }; - }; -- -- odroid_dac2{ -- compatible = "sound_card, odroid_dac2"; -- aml,sound_card = "ODROID-DAC2"; -- pinctrl-names = "odroid_i2s"; -- pinctrl-0 = <&audio_pins>; -- status = "okay"; -- }; - /* END OF AUDIO board specific */ - - aml_sensor0: aml-sensor@0 { -diff --git a/arch/arm64/configs/odroidc2_defconfig b/arch/arm64/configs/odroidc2_defconfig -index c9ca9b4..079f956 100644 ---- a/arch/arm64/configs/odroidc2_defconfig -+++ b/arch/arm64/configs/odroidc2_defconfig -@@ -1,6 +1,6 @@ - # - # Automatically generated file; DO NOT EDIT. --# Linux/arm64 3.14.77 Kernel Configuration -+# Linux/arm64 3.14.65 Kernel Configuration - # - CONFIG_ARM64=y - CONFIG_ARM64_HAS_SG_CHAIN=y -@@ -3285,13 +3285,9 @@ CONFIG_SND_AML_M8_SOC=y - # CONFIG_SND_AML_M8 is not set - CONFIG_SND_ODROID_HDMI=y - CONFIG_SND_ODROID_DAC=m --CONFIG_SND_ODROID_DAC2=m - # CONFIG_SND_AML_G9TV is not set - CONFIG_SND_SOC_I2C_AND_SPI=y - CONFIG_SND_SOC_PCM5102=m --CONFIG_SND_SOC_PCM512x=m --CONFIG_SND_SOC_PCM512x_I2C=m --# CONFIG_SND_SOC_PCM512x_SPI is not set - # CONFIG_SND_SIMPLE_CARD is not set - # CONFIG_SOUND_PRIME is not set - CONFIG_AC97_BUS=m -diff --git a/sound/soc/aml/m8/Kconfig b/sound/soc/aml/m8/Kconfig -index c1808a4..4adfb7d 100644 ---- a/sound/soc/aml/m8/Kconfig -+++ b/sound/soc/aml/m8/Kconfig -@@ -20,11 +20,6 @@ menuconfig SND_ODROID_DAC - depends on SND_AML_M8_SOC - select SND_SOC_PCM5102 - --menuconfig SND_ODROID_DAC2 -- tristate "ODROID HiFi-Shield2(pcm5242) Support" -- depends on SND_AML_M8_SOC -- select SND_SOC_PCM512x_I2C -- - menuconfig SND_AML_G9TV - tristate "AML-SND-G9TV Board" - depends on SND_AML_M8_SOC && SWITCH -diff --git a/sound/soc/aml/m8/Makefile b/sound/soc/aml/m8/Makefile -index e7310ed..2ed8755 100644 ---- a/sound/soc/aml/m8/Makefile -+++ b/sound/soc/aml/m8/Makefile -@@ -27,10 +27,8 @@ obj-$(CONFIG_SND_AML_M8) += snd-soc-aml-m8.o - #ODROID Machine support - snd-soc-odroid-hdmi-objs := odroid_hdmi.o - snd-soc-odroid-dac-objs := odroid_dac.o --snd-soc-odroid-dac2-objs := odroid_dac2.o - obj-$(CONFIG_SND_ODROID_HDMI) += snd-soc-odroid-hdmi.o - obj-$(CONFIG_SND_ODROID_DAC) += snd-soc-odroid-dac.o --obj-$(CONFIG_SND_ODROID_DAC2) += snd-soc-odroid-dac2.o - - #AML G9TV Machine support - snd-soc-aml-g9tv-objs := aml_g9tv.o -diff --git a/sound/soc/aml/m8/odroid_dac2.c b/sound/soc/aml/m8/odroid_dac2.c -deleted file mode 100644 -index fb8c153..0000000 ---- a/sound/soc/aml/m8/odroid_dac2.c -+++ /dev/null -@@ -1,217 +0,0 @@ --/* -- * sound/soc/aml/m8/aml_m8.c -- * -- * Copyright (C) 2015 Amlogic, Inc. All rights reserved. -- * -- * This program is free software; 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. -- * --*/ -- --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --#include --#include --#include --/* #include */ --#include --#include --/* #include */ --#include -- --/* #include "aml_i2s_dai.h" */ --#include "aml_i2s.h" --#include "odroid_dac2.h" --#include "aml_audio_hw.h" --#include --#include --#include --#include --#include --#include --/* extern struct device *spdif_dev; */ -- --#define DRV_NAME "odroid_dac2" -- --static int dac2_hw_params(struct snd_pcm_substream *substream, -- struct snd_pcm_hw_params *params) --{ -- struct snd_soc_pcm_runtime *rtd = substream->private_data; -- struct snd_soc_dai *codec_dai = rtd->codec_dai; -- struct snd_soc_dai *cpu_dai = rtd->cpu_dai; -- int ret; -- -- /* set codec DAI configuration */ -- ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | -- SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); -- if (ret < 0) -- return ret; -- -- /* set cpu DAI configuration */ -- ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | -- SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); -- if (ret < 0) -- return ret; -- -- /* set cpu DAI clock */ -- ret = snd_soc_dai_set_sysclk( -- cpu_dai, 0, params_rate(params)*256, SND_SOC_CLOCK_OUT); -- if (ret < 0) -- return ret; -- return 0; --} -- --static struct snd_soc_ops odroid_ops = { -- .hw_params = dac2_hw_params, --}; -- --static int dac2_set_bias_level(struct snd_soc_card *card, -- struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) --{ -- int ret = 0; -- struct dac2_private_data *p_dac2; -- -- p_dac2 = snd_soc_card_get_drvdata(card); -- if (p_dac2->bias_level == (int)level) -- return 0; -- -- p_dac2->bias_level = (int)level; -- return ret; --} --static struct snd_soc_dai_link dac2_dai_link[] = { -- { -- .name = "SND_PCM5242", -- .stream_name = "I2S", -- .cpu_dai_name = "I2S", -- .platform_name = "i2s_platform", -- .codec_name = "pcm512x.1-004c", -- .codec_dai_name = "pcm512x-hifi", -- .ops = &odroid_ops, -- }, --}; -- --static struct snd_soc_card aml_snd_soc_card = { -- .driver_name = "SOC-Audio", -- .dai_link = &dac2_dai_link[0], -- .num_links = ARRAY_SIZE(dac2_dai_link), -- .set_bias_level = dac2_set_bias_level, --}; -- --static int dac2_probe(struct platform_device *pdev) --{ -- struct snd_soc_card *card = &aml_snd_soc_card; -- struct dac2_private_data *p_dac2; -- int ret = 0; -- --#ifdef CONFIG_OF -- p_dac2 = devm_kzalloc(&pdev->dev, -- sizeof(struct dac2_private_data), GFP_KERNEL); -- if (!p_dac2) { -- dev_err(&pdev->dev, "Can't allocate dac2_private_data\n"); -- ret = -ENOMEM; -- goto err; -- } -- -- card->dev = &pdev->dev; -- platform_set_drvdata(pdev, card); -- snd_soc_card_set_drvdata(card, p_dac2); -- if (!(pdev->dev.of_node)) { -- dev_err(&pdev->dev, "Must be instantiated using device tree\n"); -- ret = -EINVAL; -- goto err; -- } -- ret = of_property_read_string(pdev->dev.of_node, -- "pinctrl-names", -- &p_dac2->pinctrl_name); -- p_dac2->pin_ctl = -- devm_pinctrl_get_select(&pdev->dev, p_dac2->pinctrl_name); -- -- ret = snd_soc_of_parse_card_name(card, "aml,sound_card"); -- if (ret) -- goto err; -- -- ret = snd_soc_register_card(card); -- if (ret) { -- dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", -- ret); -- goto err; -- } -- return 0; --#endif -- --err: -- return ret; --} -- --static int dac2_remove(struct platform_device *pdev) --{ -- struct snd_soc_card *card = platform_get_drvdata(pdev); -- struct dac2_private_data *p_dac2; -- -- p_dac2 = snd_soc_card_get_drvdata(card); -- if (p_dac2->pin_ctl) -- devm_pinctrl_put(p_dac2->pin_ctl); -- -- snd_soc_unregister_card(card); -- return 0; --} -- --#ifdef CONFIG_USE_OF --static const struct of_device_id dac2_dt_match[] = { -- { .compatible = "sound_card, odroid_dac2", }, -- {}, --}; --#else --#define dac2_dt_match NULL --#endif -- --static struct platform_driver dac2_driver = { -- .probe = dac2_probe, -- .remove = dac2_remove, -- .driver = { -- .name = DRV_NAME, -- .owner = THIS_MODULE, -- .pm = &snd_soc_pm_ops, -- .of_match_table = dac2_dt_match, -- }, --}; -- --static int __init dac2_init(void) --{ -- return platform_driver_register(&dac2_driver); --} -- --static void __exit dac2_exit(void) --{ -- platform_driver_unregister(&dac2_driver); --} -- --#ifdef CONFIG_DEFERRED_MODULE_INIT --deferred_module_init(dac2_init); --#else --module_init(dac2_init); --#endif --module_exit(dac2_exit); -- --/* Module information */ --MODULE_AUTHOR("Hardkernel, Inc."); --MODULE_DESCRIPTION("ODROID HiFi Shield-2 Asoc driver"); --MODULE_LICENSE("GPL"); --MODULE_ALIAS("platform:" DRV_NAME); -diff --git a/sound/soc/aml/m8/odroid_dac2.h b/sound/soc/aml/m8/odroid_dac2.h -deleted file mode 100644 -index d5b830d..0000000 ---- a/sound/soc/aml/m8/odroid_dac2.h -+++ /dev/null -@@ -1,31 +0,0 @@ --/* -- * sound/soc/aml/m8/aml_m8.h -- * -- * Copyright (C) 2015 Amlogic, Inc. All rights reserved. -- * -- * This program is free software; 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. -- * --*/ -- --#ifndef AML_M8_H --#define AML_M8_H -- --#include --#include --struct dac2_private_data { -- int bias_level; -- const char *pinctrl_name; -- struct pinctrl *pin_ctl; -- void *data; --}; -- --#endif -- -diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig -index c8b16fb..e9ab5e1 100644 ---- a/sound/soc/codecs/Kconfig -+++ b/sound/soc/codecs/Kconfig -@@ -135,8 +135,6 @@ config SND_SOC_ALL_CODECS - select SND_SOC_DUMMY_CODEC - select SND_SOC_PCM2BT - select SND_SOC_PCM5102 -- select SND_SOC_PCM512x_I2C if I2C -- select SND_SOC_PCM512x_SPI if SPI_MASTER - help - Normally ASoC codec drivers are only built if a machine driver which - uses them is also built since they are only usable with a machine -@@ -568,18 +566,3 @@ config SND_SOC_PCM2BT - - config SND_SOC_PCM5102 - tristate -- --config SND_SOC_PCM512x -- tristate -- --config SND_SOC_PCM512x_I2C -- tristate "Texas Instruments PCM512x CODECs - I2C" -- depends on I2C -- select SND_SOC_PCM512x -- select REGMAP_I2C -- --config SND_SOC_PCM512x_SPI -- tristate "Texas Instruments PCM512x CODECs - SPI" -- depends on SPI_MASTER -- select SND_SOC_PCM512x -- select REGMAP_SPI -diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile -index 8400601..9e024d9 100644 ---- a/sound/soc/codecs/Makefile -+++ b/sound/soc/codecs/Makefile -@@ -127,9 +127,6 @@ snd-soc-wm-hubs-objs := wm_hubs.o - snd-soc-dummy_codec-objs := dummy_codec.o - snd-soc-pcm2bt-objs := pcm2bt.o - snd-soc-pcm5102-objs := pcm5102.o --snd-soc-pcm512x-objs := pcm512x.o --snd-soc-pcm512x-i2c-objs := pcm512x-i2c.o --snd-soc-pcm512x-spi-objs := pcm512x-spi.o - - # Amp - snd-soc-max9877-objs := max9877.o -@@ -263,9 +260,6 @@ obj-$(CONFIG_SND_SOC_WM_HUBS) += snd-soc-wm-hubs.o - obj-$(CONFIG_SND_SOC_DUMMY_CODEC) += snd-soc-dummy_codec.o - obj-$(CONFIG_SND_SOC_PCM2BT) += snd-soc-pcm2bt.o - obj-$(CONFIG_SND_SOC_PCM5102) += snd-soc-pcm5102.o --obj-$(CONFIG_SND_SOC_PCM512x) += snd-soc-pcm512x.o --obj-$(CONFIG_SND_SOC_PCM512x_I2C) += snd-soc-pcm512x-i2c.o --obj-$(CONFIG_SND_SOC_PCM512x_SPI) += snd-soc-pcm512x-spi.o - - # Amp - obj-$(CONFIG_SND_SOC_MAX9877) += snd-soc-max9877.o -diff --git a/sound/soc/codecs/pcm512x-i2c.c b/sound/soc/codecs/pcm512x-i2c.c -deleted file mode 100644 -index 970eb8b..0000000 ---- a/sound/soc/codecs/pcm512x-i2c.c -+++ /dev/null -@@ -1,81 +0,0 @@ --/* -- * Driver for the PCM512x CODECs -- * -- * Author: Mark Brown -- * Copyright 2014 Linaro Ltd -- * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of the GNU General Public License -- * version 2 as published by the Free Software Foundation. -- * -- * 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. -- */ -- --#include --#include --#include -- --#include "pcm512x.h" -- --static int pcm512x_i2c_probe(struct i2c_client *i2c, -- const struct i2c_device_id *id) --{ -- struct regmap *regmap; -- struct regmap_config config = pcm512x_regmap; -- -- /* msb needs to be set to enable auto-increment of addresses */ -- config.read_flag_mask = 0x80; -- config.write_flag_mask = 0x80; -- -- regmap = devm_regmap_init_i2c(i2c, &config); -- if (IS_ERR(regmap)) -- return PTR_ERR(regmap); -- -- return pcm512x_probe(&i2c->dev, regmap); --} -- --static int pcm512x_i2c_remove(struct i2c_client *i2c) --{ -- pcm512x_remove(&i2c->dev); -- return 0; --} -- --static const struct i2c_device_id pcm512x_i2c_id[] = { -- { "pcm5121", }, -- { "pcm5122", }, -- { "pcm5141", }, -- { "pcm5142", }, -- { "pcm5242", }, -- { } --}; --MODULE_DEVICE_TABLE(i2c, pcm512x_i2c_id); -- --static const struct of_device_id pcm512x_of_match[] = { -- { .compatible = "ti,pcm5121", }, -- { .compatible = "ti,pcm5122", }, -- { .compatible = "ti,pcm5141", }, -- { .compatible = "ti,pcm5142", }, -- { .compatible = "ti,pcm5242", }, -- { } --}; --MODULE_DEVICE_TABLE(of, pcm512x_of_match); -- --static struct i2c_driver pcm512x_i2c_driver = { -- .probe = pcm512x_i2c_probe, -- .remove = pcm512x_i2c_remove, -- .id_table = pcm512x_i2c_id, -- .driver = { -- .name = "pcm512x", -- .of_match_table = pcm512x_of_match, -- .pm = &pcm512x_pm_ops, -- }, --}; -- --module_i2c_driver(pcm512x_i2c_driver); -- --MODULE_DESCRIPTION("ASoC PCM512x codec driver - I2C"); --MODULE_AUTHOR("Mark Brown "); --MODULE_LICENSE("GPL v2"); -diff --git a/sound/soc/codecs/pcm512x-spi.c b/sound/soc/codecs/pcm512x-spi.c -deleted file mode 100644 -index 712ed65..0000000 ---- a/sound/soc/codecs/pcm512x-spi.c -+++ /dev/null -@@ -1,72 +0,0 @@ --/* -- * Driver for the PCM512x CODECs -- * -- * Author: Mark Brown -- * Copyright 2014 Linaro Ltd -- * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of the GNU General Public License -- * version 2 as published by the Free Software Foundation. -- * -- * 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. -- */ -- --#include --#include --#include -- --#include "pcm512x.h" -- --static int pcm512x_spi_probe(struct spi_device *spi) --{ -- struct regmap *regmap; -- int ret; -- -- regmap = devm_regmap_init_spi(spi, &pcm512x_regmap); -- if (IS_ERR(regmap)) { -- ret = PTR_ERR(regmap); -- return ret; -- } -- -- return pcm512x_probe(&spi->dev, regmap); --} -- --static int pcm512x_spi_remove(struct spi_device *spi) --{ -- pcm512x_remove(&spi->dev); -- return 0; --} -- --static const struct spi_device_id pcm512x_spi_id[] = { -- { "pcm5121", }, -- { "pcm5122", }, -- { "pcm5141", }, -- { "pcm5142", }, -- { }, --}; --MODULE_DEVICE_TABLE(spi, pcm512x_spi_id); -- --static const struct of_device_id pcm512x_of_match[] = { -- { .compatible = "ti,pcm5121", }, -- { .compatible = "ti,pcm5122", }, -- { .compatible = "ti,pcm5141", }, -- { .compatible = "ti,pcm5142", }, -- { } --}; --MODULE_DEVICE_TABLE(of, pcm512x_of_match); -- --static struct spi_driver pcm512x_spi_driver = { -- .probe = pcm512x_spi_probe, -- .remove = pcm512x_spi_remove, -- .id_table = pcm512x_spi_id, -- .driver = { -- .name = "pcm512x", -- .of_match_table = pcm512x_of_match, -- .pm = &pcm512x_pm_ops, -- }, --}; -- --module_spi_driver(pcm512x_spi_driver); -diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c -deleted file mode 100644 -index 88edd8e..0000000 ---- a/sound/soc/codecs/pcm512x.c -+++ /dev/null -@@ -1,609 +0,0 @@ --/* -- * Driver for the PCM512x CODECs -- * -- * Author: Mark Brown -- * Copyright 2014 Linaro Ltd -- * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of the GNU General Public License -- * version 2 as published by the Free Software Foundation. -- * -- * 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. -- */ -- -- --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --#include "pcm512x.h" -- --struct pcm512x_priv { -- struct regmap *regmap; -- struct clk *sclk; --}; -- --static const struct reg_default pcm512x_reg_defaults[] = { -- { PCM512x_RESET, 0x00 }, -- { PCM512x_POWER, 0x00 }, -- { PCM512x_MUTE, 0x00 }, -- { PCM512x_DSP, 0x00 }, -- { PCM512x_PLL_REF, 0x00 }, -- { PCM512x_DAC_ROUTING, 0x11 }, -- { PCM512x_DSP_PROGRAM, 0x01 }, -- { PCM512x_CLKDET, 0x00 }, -- { PCM512x_AUTO_MUTE, 0x00 }, -- { PCM512x_ERROR_DETECT, 0x00 }, -- { PCM512x_DIGITAL_VOLUME_1, 0x00 }, -- { PCM512x_DIGITAL_VOLUME_2, 0x30 }, -- { PCM512x_DIGITAL_VOLUME_3, 0x30 }, -- { PCM512x_DIGITAL_MUTE_1, 0x22 }, -- { PCM512x_DIGITAL_MUTE_2, 0x00 }, -- { PCM512x_DIGITAL_MUTE_3, 0x07 }, -- { PCM512x_OUTPUT_AMPLITUDE, 0x00 }, -- { PCM512x_ANALOG_GAIN_CTRL, 0x00 }, -- { PCM512x_UNDERVOLTAGE_PROT, 0x00 }, -- { PCM512x_ANALOG_MUTE_CTRL, 0x00 }, -- { PCM512x_ANALOG_GAIN_BOOST, 0x00 }, -- { PCM512x_VCOM_CTRL_1, 0x00 }, -- { PCM512x_VCOM_CTRL_2, 0x01 }, --}; -- --static bool pcm512x_readable(struct device *dev, unsigned int reg) --{ -- switch (reg) { -- case PCM512x_RESET: -- case PCM512x_POWER: -- case PCM512x_MUTE: -- case PCM512x_PLL_EN: -- case PCM512x_SPI_MISO_FUNCTION: -- case PCM512x_DSP: -- case PCM512x_GPIO_EN: -- case PCM512x_BCLK_LRCLK_CFG: -- case PCM512x_DSP_GPIO_INPUT: -- case PCM512x_MASTER_MODE: -- case PCM512x_PLL_REF: -- case PCM512x_PLL_COEFF_0: -- case PCM512x_PLL_COEFF_1: -- case PCM512x_PLL_COEFF_2: -- case PCM512x_PLL_COEFF_3: -- case PCM512x_PLL_COEFF_4: -- case PCM512x_DSP_CLKDIV: -- case PCM512x_DAC_CLKDIV: -- case PCM512x_NCP_CLKDIV: -- case PCM512x_OSR_CLKDIV: -- case PCM512x_MASTER_CLKDIV_1: -- case PCM512x_MASTER_CLKDIV_2: -- case PCM512x_FS_SPEED_MODE: -- case PCM512x_IDAC_1: -- case PCM512x_IDAC_2: -- case PCM512x_ERROR_DETECT: -- case PCM512x_I2S_1: -- case PCM512x_I2S_2: -- case PCM512x_DAC_ROUTING: -- case PCM512x_DSP_PROGRAM: -- case PCM512x_CLKDET: -- case PCM512x_AUTO_MUTE: -- case PCM512x_DIGITAL_VOLUME_1: -- case PCM512x_DIGITAL_VOLUME_2: -- case PCM512x_DIGITAL_VOLUME_3: -- case PCM512x_DIGITAL_MUTE_1: -- case PCM512x_DIGITAL_MUTE_2: -- case PCM512x_DIGITAL_MUTE_3: -- case PCM512x_GPIO_OUTPUT_1: -- case PCM512x_GPIO_OUTPUT_2: -- case PCM512x_GPIO_OUTPUT_3: -- case PCM512x_GPIO_OUTPUT_4: -- case PCM512x_GPIO_OUTPUT_5: -- case PCM512x_GPIO_OUTPUT_6: -- case PCM512x_GPIO_CONTROL_1: -- case PCM512x_GPIO_CONTROL_2: -- case PCM512x_OVERFLOW: -- case PCM512x_RATE_DET_1: -- case PCM512x_RATE_DET_2: -- case PCM512x_RATE_DET_3: -- case PCM512x_RATE_DET_4: -- case PCM512x_ANALOG_MUTE_DET: -- case PCM512x_GPIN: -- case PCM512x_DIGITAL_MUTE_DET: -- case PCM512x_OUTPUT_AMPLITUDE: -- case PCM512x_ANALOG_GAIN_CTRL: -- case PCM512x_UNDERVOLTAGE_PROT: -- case PCM512x_ANALOG_MUTE_CTRL: -- case PCM512x_ANALOG_GAIN_BOOST: -- case PCM512x_VCOM_CTRL_1: -- case PCM512x_VCOM_CTRL_2: -- case PCM512x_CRAM_CTRL: -- return true; -- default: -- /* There are 256 raw register addresses */ -- return reg < 0xff; -- } --} -- --static bool pcm512x_volatile(struct device *dev, unsigned int reg) --{ -- switch (reg) { -- case PCM512x_PLL_EN: -- case PCM512x_OVERFLOW: -- case PCM512x_RATE_DET_1: -- case PCM512x_RATE_DET_2: -- case PCM512x_RATE_DET_3: -- case PCM512x_RATE_DET_4: -- case PCM512x_ANALOG_MUTE_DET: -- case PCM512x_GPIN: -- case PCM512x_DIGITAL_MUTE_DET: -- case PCM512x_CRAM_CTRL: -- return true; -- default: -- /* There are 256 raw register addresses */ -- return reg < 0xff; -- } --} -- --static const DECLARE_TLV_DB_SCALE(digital_tlv, -10350, 50, 1); --static const DECLARE_TLV_DB_SCALE(analog_tlv, -600, 600, 0); --static const DECLARE_TLV_DB_SCALE(boost_tlv, 0, 80, 0); -- --static const char * const pcm512x_dsp_program_texts[] = { -- "FIR interpolation with de-emphasis", -- "Low latency IIR with de-emphasis", -- "High attenuation with de-emphasis", -- "Fixed process flow", -- "Ringing-less low latency FIR", --}; -- --static const unsigned int pcm512x_dsp_program_values[] = { -- 1, -- 2, -- 3, -- 5, -- 7, --}; -- --static SOC_VALUE_ENUM_SINGLE_DECL(pcm512x_dsp_program, -- PCM512x_DSP_PROGRAM, 0, 0x1f, -- pcm512x_dsp_program_texts, -- pcm512x_dsp_program_values); -- --static const char * const pcm512x_clk_missing_text[] = { -- "1s", "2s", "3s", "4s", "5s", "6s", "7s", "8s" --}; -- --static const struct soc_enum pcm512x_clk_missing = -- SOC_ENUM_SINGLE(PCM512x_CLKDET, 0, 8, pcm512x_clk_missing_text); -- --static const char * const pcm512x_autom_text[] = { -- "21ms", "106ms", "213ms", "533ms", "1.07s", "2.13s", "5.33s", "10.66s" --}; -- --static const struct soc_enum pcm512x_autom_l = -- SOC_ENUM_SINGLE(PCM512x_AUTO_MUTE, PCM512x_ATML_SHIFT, 8, -- pcm512x_autom_text); -- --static const struct soc_enum pcm512x_autom_r = -- SOC_ENUM_SINGLE(PCM512x_AUTO_MUTE, PCM512x_ATMR_SHIFT, 8, -- pcm512x_autom_text); -- --static const char * const pcm512x_ramp_rate_text[] = { -- "1 sample/update", "2 samples/update", "4 samples/update", -- "Immediate" --}; -- --static const struct soc_enum pcm512x_vndf = -- SOC_ENUM_SINGLE(PCM512x_DIGITAL_MUTE_1, PCM512x_VNDF_SHIFT, 4, -- pcm512x_ramp_rate_text); -- --static const struct soc_enum pcm512x_vnuf = -- SOC_ENUM_SINGLE(PCM512x_DIGITAL_MUTE_1, PCM512x_VNUF_SHIFT, 4, -- pcm512x_ramp_rate_text); -- --static const struct soc_enum pcm512x_vedf = -- SOC_ENUM_SINGLE(PCM512x_DIGITAL_MUTE_2, PCM512x_VEDF_SHIFT, 4, -- pcm512x_ramp_rate_text); -- --static const char * const pcm512x_ramp_step_text[] = { -- "4dB/step", "2dB/step", "1dB/step", "0.5dB/step" --}; -- --static const struct soc_enum pcm512x_vnds = -- SOC_ENUM_SINGLE(PCM512x_DIGITAL_MUTE_1, PCM512x_VNDS_SHIFT, 4, -- pcm512x_ramp_step_text); -- --static const struct soc_enum pcm512x_vnus = -- SOC_ENUM_SINGLE(PCM512x_DIGITAL_MUTE_1, PCM512x_VNUS_SHIFT, 4, -- pcm512x_ramp_step_text); -- --static const struct soc_enum pcm512x_veds = -- SOC_ENUM_SINGLE(PCM512x_DIGITAL_MUTE_2, PCM512x_VEDS_SHIFT, 4, -- pcm512x_ramp_step_text); -- --static const struct snd_kcontrol_new pcm512x_controls[] = { --SOC_DOUBLE_R_TLV("Digital Playback Volume", PCM512x_DIGITAL_VOLUME_2, -- PCM512x_DIGITAL_VOLUME_3, 0, 255, 1, digital_tlv), --SOC_DOUBLE_TLV("Analogue Playback Volume", PCM512x_ANALOG_GAIN_CTRL, -- PCM512x_LAGN_SHIFT, PCM512x_RAGN_SHIFT, 1, 1, analog_tlv), --SOC_DOUBLE_TLV("Analogue Playback Boost Volume", PCM512x_ANALOG_GAIN_BOOST, -- PCM512x_AGBL_SHIFT, PCM512x_AGBR_SHIFT, 1, 0, boost_tlv), --SOC_DOUBLE("Digital Playback Switch", PCM512x_MUTE, PCM512x_RQML_SHIFT, -- PCM512x_RQMR_SHIFT, 1, 1), -- --SOC_SINGLE("Deemphasis Switch", PCM512x_DSP, PCM512x_DEMP_SHIFT, 1, 1), --SOC_ENUM("DSP Program", pcm512x_dsp_program), -- --SOC_ENUM("Clock Missing Period", pcm512x_clk_missing), --SOC_ENUM("Auto Mute Time Left", pcm512x_autom_l), --SOC_ENUM("Auto Mute Time Right", pcm512x_autom_r), --SOC_SINGLE("Auto Mute Mono Switch", PCM512x_DIGITAL_MUTE_3, -- PCM512x_ACTL_SHIFT, 1, 0), --SOC_DOUBLE("Auto Mute Switch", PCM512x_DIGITAL_MUTE_3, PCM512x_AMLE_SHIFT, -- PCM512x_AMLR_SHIFT, 1, 0), -- --SOC_ENUM("Volume Ramp Down Rate", pcm512x_vndf), --SOC_ENUM("Volume Ramp Down Step", pcm512x_vnds), --SOC_ENUM("Volume Ramp Up Rate", pcm512x_vnuf), --SOC_ENUM("Volume Ramp Up Step", pcm512x_vnus), --SOC_ENUM("Volume Ramp Down Emergency Rate", pcm512x_vedf), --SOC_ENUM("Volume Ramp Down Emergency Step", pcm512x_veds), --}; -- --static const struct snd_soc_dapm_widget pcm512x_dapm_widgets[] = { --SND_SOC_DAPM_DAC("DACL", NULL, SND_SOC_NOPM, 0, 0), --SND_SOC_DAPM_DAC("DACR", NULL, SND_SOC_NOPM, 0, 0), -- --SND_SOC_DAPM_OUTPUT("OUTL"), --SND_SOC_DAPM_OUTPUT("OUTR"), --}; -- --static const struct snd_soc_dapm_route pcm512x_dapm_routes[] = { -- { "DACL", NULL, "Playback" }, -- { "DACR", NULL, "Playback" }, -- -- { "OUTL", NULL, "DACL" }, -- { "OUTR", NULL, "DACR" }, --}; -- --static int pcm512x_set_bias_level(struct snd_soc_codec *codec, -- enum snd_soc_bias_level level) --{ -- struct pcm512x_priv *pcm512x = dev_get_drvdata(codec->dev); -- int ret; -- -- switch (level) { -- case SND_SOC_BIAS_ON: -- case SND_SOC_BIAS_PREPARE: -- break; -- -- case SND_SOC_BIAS_STANDBY: -- ret = regmap_update_bits(pcm512x->regmap, PCM512x_POWER, -- PCM512x_RQST, 0); -- if (ret != 0) { -- dev_err(codec->dev, "Failed to remove standby: %d\n", -- ret); -- return ret; -- } -- break; -- -- case SND_SOC_BIAS_OFF: -- ret = regmap_update_bits(pcm512x->regmap, PCM512x_POWER, -- PCM512x_RQST, PCM512x_RQST); -- if (ret != 0) { -- dev_err(codec->dev, "Failed to request standby: %d\n", -- ret); -- return ret; -- } -- break; -- } -- -- codec->dapm.bias_level = level; -- -- return 0; --} -- --static int pcm512x_hw_params(struct snd_pcm_substream *substream, -- struct snd_pcm_hw_params *params, -- struct snd_soc_dai *dai) --{ -- struct snd_soc_codec *codec = dai->codec; -- struct pcm512x_priv *pcm512x = dev_get_drvdata(codec->dev); -- struct regmap *regmap = pcm512x->regmap; -- u8 bck_div, length, fs_speed; -- int ret; -- -- switch (params_format(params)) { -- case SNDRV_PCM_FORMAT_S16_LE: -- length = 0; -- break; -- case SNDRV_PCM_FORMAT_S20_3LE: -- length = 1; -- break; -- case SNDRV_PCM_FORMAT_S24_LE: -- length = 2; -- break; -- case SNDRV_PCM_FORMAT_S32_LE: -- length = 3; -- break; -- default: -- length = 0; -- break; -- } -- -- switch (params_rate(params)) { -- case 8000: -- case 11025: -- case 12000: -- case 16000: -- case 22050: -- case 32000: -- case 44100: -- case 48000: -- bck_div = 255; -- fs_speed = 0; -- break; -- case 88200: -- case 96000: -- bck_div = 255; -- fs_speed = 1; -- break; -- case 192000: -- bck_div = 255; -- fs_speed = 2; -- break; -- case 352800: -- case 384000: -- bck_div = 127; -- fs_speed = 3; -- break; -- default: -- bck_div = 255; -- fs_speed = 0; -- break; -- } -- -- ret = regmap_write(regmap, PCM512x_I2S_1, length); -- if (ret != 0) { -- dev_err(codec->dev, "Failed to I2S Data Format: %d\n", ret); -- goto err; -- } -- -- ret = regmap_write(regmap, PCM512x_FS_SPEED_MODE, fs_speed); -- if (ret != 0) { -- dev_err(codec->dev, "Failed to BCK rate: %d\n", ret); -- goto err; -- } -- --err: -- return ret; --} -- -- --static int pcm512x_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) --{ -- return 0; --} -- --static int pcm512x_set_sysclk(struct snd_soc_dai *dai, -- int clk_id, unsigned int freq, int dir) --{ -- return 0; --} -- --static const struct snd_soc_dai_ops pcm512x_dai_ops = { -- .set_sysclk = pcm512x_set_sysclk, -- .hw_params = pcm512x_hw_params, -- .set_fmt = pcm512x_set_fmt, --}; -- --static struct snd_soc_dai_driver pcm512x_dai = { -- .name = "pcm512x-hifi", -- .playback = { -- .stream_name = "Playback", -- .channels_min = 2, -- .channels_max = 2, -- .rates = SNDRV_PCM_RATE_8000_384000, -- .formats = SNDRV_PCM_FMTBIT_S16_LE | -- SNDRV_PCM_FMTBIT_S24_LE | -- SNDRV_PCM_FMTBIT_S32_LE -- }, -- .ops = &pcm512x_dai_ops, --}; -- --static struct snd_soc_codec_driver pcm512x_codec_driver = { -- .set_bias_level = pcm512x_set_bias_level, -- .idle_bias_off = true, -- -- .controls = pcm512x_controls, -- .num_controls = ARRAY_SIZE(pcm512x_controls), -- .dapm_widgets = pcm512x_dapm_widgets, -- .num_dapm_widgets = ARRAY_SIZE(pcm512x_dapm_widgets), -- .dapm_routes = pcm512x_dapm_routes, -- .num_dapm_routes = ARRAY_SIZE(pcm512x_dapm_routes), --}; -- --static const struct regmap_range_cfg pcm512x_range = { -- .name = "Pages", .range_min = PCM512x_VIRT_BASE, -- .range_max = PCM512x_MAX_REGISTER, -- .selector_reg = PCM512x_PAGE, -- .selector_mask = 0xff, -- .window_start = 0, .window_len = 0x100, --}; -- --const struct regmap_config pcm512x_regmap = { -- .reg_bits = 8, -- .val_bits = 8, -- -- .readable_reg = pcm512x_readable, -- .volatile_reg = pcm512x_volatile, -- -- .ranges = &pcm512x_range, -- .num_ranges = 1, -- -- .max_register = PCM512x_MAX_REGISTER, -- .reg_defaults = pcm512x_reg_defaults, -- .num_reg_defaults = ARRAY_SIZE(pcm512x_reg_defaults), -- .cache_type = REGCACHE_RBTREE, --}; --EXPORT_SYMBOL_GPL(pcm512x_regmap); -- --int pcm512x_probe(struct device *dev, struct regmap *regmap) --{ -- struct pcm512x_priv *pcm512x; -- int ret; -- -- pcm512x = devm_kzalloc(dev, sizeof(struct pcm512x_priv), GFP_KERNEL); -- if (!pcm512x) -- return -ENOMEM; -- -- dev_set_drvdata(dev, pcm512x); -- pcm512x->regmap = regmap; -- -- /* Reset the device, verifying I/O in the process for I2C */ -- ret = regmap_write(regmap, PCM512x_RESET, -- PCM512x_RSTM | PCM512x_RSTR); -- if (ret != 0) { -- dev_err(dev, "Failed to reset device: %d\n", ret); -- goto err; -- } -- -- ret = regmap_write(regmap, PCM512x_RESET, 0); -- if (ret != 0) { -- dev_err(dev, "Failed to reset device: %d\n", ret); -- goto err; -- } -- -- pcm512x->sclk = devm_clk_get(dev, NULL); -- if (IS_ERR(pcm512x->sclk)) { -- if (PTR_ERR(pcm512x->sclk) == -EPROBE_DEFER) -- return -EPROBE_DEFER; -- -- dev_info(dev, "No SCLK, using BCLK: %ld\n", -- PTR_ERR(pcm512x->sclk)); -- -- /* Disable reporting of missing SCLK as an error */ -- regmap_update_bits(regmap, PCM512x_ERROR_DETECT, -- PCM512x_IDCH, PCM512x_IDCH); -- -- /* Internal PLL off, master clock switched to SCK */ -- regmap_update_bits(regmap, PCM512x_PLL_EN, -- PCM512x_PLCE, 0); -- -- } else { -- ret = clk_prepare_enable(pcm512x->sclk); -- if (ret != 0) { -- dev_err(dev, "Failed to enable SCLK: %d\n", ret); -- return ret; -- } -- } -- -- /* Default to standby mode */ -- ret = regmap_update_bits(pcm512x->regmap, PCM512x_POWER, -- PCM512x_RQST, PCM512x_RQST); -- if (ret != 0) { -- dev_err(dev, "Failed to request standby: %d\n", -- ret); -- goto err_clk; -- } -- -- pm_runtime_set_active(dev); -- pm_runtime_enable(dev); -- pm_runtime_idle(dev); -- -- ret = snd_soc_register_codec(dev, &pcm512x_codec_driver, -- &pcm512x_dai, 1); -- if (ret != 0) { -- dev_err(dev, "Failed to register CODEC: %d\n", ret); -- goto err_pm; -- } -- -- return 0; -- --err_pm: -- pm_runtime_disable(dev); --err_clk: -- if (!IS_ERR(pcm512x->sclk)) -- clk_disable_unprepare(pcm512x->sclk); --err: -- return ret; --} --EXPORT_SYMBOL_GPL(pcm512x_probe); -- --void pcm512x_remove(struct device *dev) --{ -- struct pcm512x_priv *pcm512x = dev_get_drvdata(dev); -- -- snd_soc_unregister_codec(dev); -- pm_runtime_disable(dev); -- if (!IS_ERR(pcm512x->sclk)) -- clk_disable_unprepare(pcm512x->sclk); --} --EXPORT_SYMBOL_GPL(pcm512x_remove); -- --#ifdef CONFIG_PM_RUNTIME --static int pcm512x_suspend(struct device *dev) --{ -- struct pcm512x_priv *pcm512x = dev_get_drvdata(dev); -- int ret; -- -- ret = regmap_update_bits(pcm512x->regmap, PCM512x_POWER, -- PCM512x_RQPD, PCM512x_RQPD); -- if (ret != 0) { -- dev_err(dev, "Failed to request power down: %d\n", ret); -- return ret; -- } -- -- if (!IS_ERR(pcm512x->sclk)) -- clk_disable_unprepare(pcm512x->sclk); -- -- return 0; --} -- --static int pcm512x_resume(struct device *dev) --{ -- struct pcm512x_priv *pcm512x = dev_get_drvdata(dev); -- int ret; -- -- if (!IS_ERR(pcm512x->sclk)) { -- ret = clk_prepare_enable(pcm512x->sclk); -- if (ret != 0) { -- dev_err(dev, "Failed to enable SCLK: %d\n", ret); -- return ret; -- } -- } -- -- regcache_cache_only(pcm512x->regmap, false); -- ret = regcache_sync(pcm512x->regmap); -- if (ret != 0) { -- dev_err(dev, "Failed to sync cache: %d\n", ret); -- return ret; -- } -- -- ret = regmap_update_bits(pcm512x->regmap, PCM512x_POWER, -- PCM512x_RQPD, 0); -- if (ret != 0) { -- dev_err(dev, "Failed to remove power down: %d\n", ret); -- return ret; -- } -- -- return 0; --} --#endif -- --const struct dev_pm_ops pcm512x_pm_ops = { -- SET_RUNTIME_PM_OPS(pcm512x_suspend, pcm512x_resume, NULL) --}; --EXPORT_SYMBOL_GPL(pcm512x_pm_ops); -- --MODULE_DESCRIPTION("ASoC PCM512x codec driver"); --MODULE_AUTHOR("Mark Brown "); --MODULE_LICENSE("GPL v2"); -diff --git a/sound/soc/codecs/pcm512x.h b/sound/soc/codecs/pcm512x.h -deleted file mode 100644 -index 6ee76aa..0000000 ---- a/sound/soc/codecs/pcm512x.h -+++ /dev/null -@@ -1,171 +0,0 @@ --/* -- * Driver for the PCM512x CODECs -- * -- * Author: Mark Brown -- * Copyright 2014 Linaro Ltd -- * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of the GNU General Public License -- * version 2 as published by the Free Software Foundation. -- * -- * 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. -- */ -- --#ifndef _SND_SOC_PCM512X --#define _SND_SOC_PCM512X -- --#include --#include -- --#define PCM512x_VIRT_BASE 0x100 --#define PCM512x_PAGE_LEN 0x100 --#define PCM512x_PAGE_BASE(n) (PCM512x_VIRT_BASE + (PCM512x_PAGE_LEN * n)) -- --#define PCM512x_PAGE 0 -- --#define PCM512x_RESET (PCM512x_PAGE_BASE(0) + 1) --#define PCM512x_POWER (PCM512x_PAGE_BASE(0) + 2) --#define PCM512x_MUTE (PCM512x_PAGE_BASE(0) + 3) --#define PCM512x_PLL_EN (PCM512x_PAGE_BASE(0) + 4) --#define PCM512x_SPI_MISO_FUNCTION (PCM512x_PAGE_BASE(0) + 6) --#define PCM512x_DSP (PCM512x_PAGE_BASE(0) + 7) --#define PCM512x_GPIO_EN (PCM512x_PAGE_BASE(0) + 8) --#define PCM512x_BCLK_LRCLK_CFG (PCM512x_PAGE_BASE(0) + 9) --#define PCM512x_DSP_GPIO_INPUT (PCM512x_PAGE_BASE(0) + 10) --#define PCM512x_MASTER_MODE (PCM512x_PAGE_BASE(0) + 12) --#define PCM512x_PLL_REF (PCM512x_PAGE_BASE(0) + 13) --#define PCM512x_PLL_COEFF_0 (PCM512x_PAGE_BASE(0) + 20) --#define PCM512x_PLL_COEFF_1 (PCM512x_PAGE_BASE(0) + 21) --#define PCM512x_PLL_COEFF_2 (PCM512x_PAGE_BASE(0) + 22) --#define PCM512x_PLL_COEFF_3 (PCM512x_PAGE_BASE(0) + 23) --#define PCM512x_PLL_COEFF_4 (PCM512x_PAGE_BASE(0) + 24) --#define PCM512x_DSP_CLKDIV (PCM512x_PAGE_BASE(0) + 27) --#define PCM512x_DAC_CLKDIV (PCM512x_PAGE_BASE(0) + 28) --#define PCM512x_NCP_CLKDIV (PCM512x_PAGE_BASE(0) + 29) --#define PCM512x_OSR_CLKDIV (PCM512x_PAGE_BASE(0) + 30) --#define PCM512x_MASTER_CLKDIV_1 (PCM512x_PAGE_BASE(0) + 32) --#define PCM512x_MASTER_CLKDIV_2 (PCM512x_PAGE_BASE(0) + 33) --#define PCM512x_FS_SPEED_MODE (PCM512x_PAGE_BASE(0) + 34) --#define PCM512x_IDAC_1 (PCM512x_PAGE_BASE(0) + 35) --#define PCM512x_IDAC_2 (PCM512x_PAGE_BASE(0) + 36) --#define PCM512x_ERROR_DETECT (PCM512x_PAGE_BASE(0) + 37) --#define PCM512x_I2S_1 (PCM512x_PAGE_BASE(0) + 40) --#define PCM512x_I2S_2 (PCM512x_PAGE_BASE(0) + 41) --#define PCM512x_DAC_ROUTING (PCM512x_PAGE_BASE(0) + 42) --#define PCM512x_DSP_PROGRAM (PCM512x_PAGE_BASE(0) + 43) --#define PCM512x_CLKDET (PCM512x_PAGE_BASE(0) + 44) --#define PCM512x_AUTO_MUTE (PCM512x_PAGE_BASE(0) + 59) --#define PCM512x_DIGITAL_VOLUME_1 (PCM512x_PAGE_BASE(0) + 60) --#define PCM512x_DIGITAL_VOLUME_2 (PCM512x_PAGE_BASE(0) + 61) --#define PCM512x_DIGITAL_VOLUME_3 (PCM512x_PAGE_BASE(0) + 62) --#define PCM512x_DIGITAL_MUTE_1 (PCM512x_PAGE_BASE(0) + 63) --#define PCM512x_DIGITAL_MUTE_2 (PCM512x_PAGE_BASE(0) + 64) --#define PCM512x_DIGITAL_MUTE_3 (PCM512x_PAGE_BASE(0) + 65) --#define PCM512x_GPIO_OUTPUT_1 (PCM512x_PAGE_BASE(0) + 80) --#define PCM512x_GPIO_OUTPUT_2 (PCM512x_PAGE_BASE(0) + 81) --#define PCM512x_GPIO_OUTPUT_3 (PCM512x_PAGE_BASE(0) + 82) --#define PCM512x_GPIO_OUTPUT_4 (PCM512x_PAGE_BASE(0) + 83) --#define PCM512x_GPIO_OUTPUT_5 (PCM512x_PAGE_BASE(0) + 84) --#define PCM512x_GPIO_OUTPUT_6 (PCM512x_PAGE_BASE(0) + 85) --#define PCM512x_GPIO_CONTROL_1 (PCM512x_PAGE_BASE(0) + 86) --#define PCM512x_GPIO_CONTROL_2 (PCM512x_PAGE_BASE(0) + 87) --#define PCM512x_OVERFLOW (PCM512x_PAGE_BASE(0) + 90) --#define PCM512x_RATE_DET_1 (PCM512x_PAGE_BASE(0) + 91) --#define PCM512x_RATE_DET_2 (PCM512x_PAGE_BASE(0) + 92) --#define PCM512x_RATE_DET_3 (PCM512x_PAGE_BASE(0) + 93) --#define PCM512x_RATE_DET_4 (PCM512x_PAGE_BASE(0) + 94) --#define PCM512x_ANALOG_MUTE_DET (PCM512x_PAGE_BASE(0) + 108) --#define PCM512x_GPIN (PCM512x_PAGE_BASE(0) + 119) --#define PCM512x_DIGITAL_MUTE_DET (PCM512x_PAGE_BASE(0) + 120) -- --#define PCM512x_OUTPUT_AMPLITUDE (PCM512x_PAGE_BASE(1) + 1) --#define PCM512x_ANALOG_GAIN_CTRL (PCM512x_PAGE_BASE(1) + 2) --#define PCM512x_UNDERVOLTAGE_PROT (PCM512x_PAGE_BASE(1) + 5) --#define PCM512x_ANALOG_MUTE_CTRL (PCM512x_PAGE_BASE(1) + 6) --#define PCM512x_ANALOG_GAIN_BOOST (PCM512x_PAGE_BASE(1) + 7) --#define PCM512x_VCOM_CTRL_1 (PCM512x_PAGE_BASE(1) + 8) --#define PCM512x_VCOM_CTRL_2 (PCM512x_PAGE_BASE(1) + 9) -- --#define PCM512x_CRAM_CTRL (PCM512x_PAGE_BASE(44) + 1) -- --#define PCM512x_MAX_REGISTER (PCM512x_PAGE_BASE(44) + 1) -- --/* Page 0, Register 1 - reset */ --#define PCM512x_RSTR (1 << 0) --#define PCM512x_RSTM (1 << 4) -- --/* Page 0, Register 2 - power */ --#define PCM512x_RQPD (1 << 0) --#define PCM512x_RQPD_SHIFT 0 --#define PCM512x_RQST (1 << 4) --#define PCM512x_RQST_SHIFT 4 -- --/* Page 0, Register 3 - mute */ --#define PCM512x_RQMR_SHIFT 0 --#define PCM512x_RQML_SHIFT 4 -- --/* Page 0, Register 4 - PLL */ --#define PCM512x_PLCE (1 << 0) --#define PCM512x_RLCE_SHIFT 0 --#define PCM512x_PLCK (1 << 4) --#define PCM512x_PLCK_SHIFT 4 -- --/* Page 0, Register 7 - DSP */ --#define PCM512x_SDSL (1 << 0) --#define PCM512x_SDSL_SHIFT 0 --#define PCM512x_DEMP (1 << 4) --#define PCM512x_DEMP_SHIFT 4 -- --/* Page 0, Register 13 - PLL reference */ --#define PCM512x_SREF (1 << 4) -- --/* Page 0, Register 37 - Error detection */ --#define PCM512x_IPLK (1 << 0) --#define PCM512x_DCAS (1 << 1) --#define PCM512x_IDCM (1 << 2) --#define PCM512x_IDCH (1 << 3) --#define PCM512x_IDSK (1 << 4) --#define PCM512x_IDBK (1 << 5) --#define PCM512x_IDFS (1 << 6) -- --/* Page 0, Register 42 - DAC routing */ --#define PCM512x_AUPR_SHIFT 0 --#define PCM512x_AUPL_SHIFT 4 -- --/* Page 0, Register 59 - auto mute */ --#define PCM512x_ATMR_SHIFT 0 --#define PCM512x_ATML_SHIFT 4 -- --/* Page 0, Register 63 - ramp rates */ --#define PCM512x_VNDF_SHIFT 6 --#define PCM512x_VNDS_SHIFT 4 --#define PCM512x_VNUF_SHIFT 2 --#define PCM512x_VNUS_SHIFT 0 -- --/* Page 0, Register 64 - emergency ramp rates */ --#define PCM512x_VEDF_SHIFT 6 --#define PCM512x_VEDS_SHIFT 4 -- --/* Page 0, Register 65 - Digital mute enables */ --#define PCM512x_ACTL_SHIFT 2 --#define PCM512x_AMLE_SHIFT 1 --#define PCM512x_AMLR_SHIFT 0 -- --/* Page 1, Register 2 - analog volume control */ --#define PCM512x_RAGN_SHIFT 0 --#define PCM512x_LAGN_SHIFT 4 -- --/* Page 1, Register 7 - analog boost control */ --#define PCM512x_AGBR_SHIFT 0 --#define PCM512x_AGBL_SHIFT 4 -- --extern const struct dev_pm_ops pcm512x_pm_ops; --extern const struct regmap_config pcm512x_regmap; -- --int pcm512x_probe(struct device *dev, struct regmap *regmap); --void pcm512x_remove(struct device *dev); -- --#endif --- -1.9.1 - diff --git a/projects/Odroid_C2/patches/linux/linux-001-Revert-all-Odroid-custom-audio-mods-for-HiFi-Shield1-and-usb-DAC.patch b/projects/Odroid_C2/patches/linux/linux-001-Revert-all-Odroid-custom-audio-mods-for-HiFi-Shield1-and-usb-DAC.patch deleted file mode 100644 index 2e2b24dc69..0000000000 --- a/projects/Odroid_C2/patches/linux/linux-001-Revert-all-Odroid-custom-audio-mods-for-HiFi-Shield1-and-usb-DAC.patch +++ /dev/null @@ -1,1702 +0,0 @@ -From b0bc68d9bfb8d33badd3c0f2f583934219bff120 Mon Sep 17 00:00:00 2001 -From: Jamie Coldhill -Date: Mon, 19 Sep 2016 19:15:16 +0800 -Subject: [PATCH] - Revert.all.Odroid.Specific.Sound.Mods.for.HiFi.Shield.and.usb_dac - ---- - arch/arm64/boot/dts/meson64_odroidc2.dts | 143 ++++++------ - arch/arm64/configs/odroidc2_defconfig | 12 +- - drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_main.c | 2 +- - include/sound/pcm.h | 5 - - sound/core/pcm_native.c | 3 +- - sound/soc/aml/m8/Kconfig | 9 - - sound/soc/aml/m8/Makefile | 6 - - sound/soc/aml/m8/aml_audio_hw.c | 13 +- - sound/soc/aml/m8/aml_audio_hw.h | 2 +- - sound/soc/aml/m8/aml_i2s.c | 83 +++---- - sound/soc/aml/m8/aml_i2s_dai.c | 55 ++--- - sound/soc/aml/m8/aml_m8.c | 2 + - sound/soc/aml/m8/aml_spdif_codec.c | 2 +- - sound/soc/aml/m8/aml_spdif_dai.c | 110 +++++++--- - sound/soc/aml/m8/aml_spdif_dai.h | 4 +- - sound/soc/aml/m8/odroid_dac.c | 292 ------------------------- - sound/soc/aml/m8/odroid_hdmi.c | 262 ---------------------- - sound/soc/aml/m8/odroid_hdmi.h | 31 --- - sound/soc/codecs/Kconfig | 4 - - sound/soc/codecs/Makefile | 2 - - sound/soc/codecs/pcm5102.c | 161 -------------- - 21 files changed, 222 insertions(+), 981 deletions(-) - mode change 100755 => 100644 arch/arm64/boot/dts/meson64_odroidc2.dts - delete mode 100644 sound/soc/aml/m8/odroid_dac.c - delete mode 100644 sound/soc/aml/m8/odroid_hdmi.c - delete mode 100644 sound/soc/aml/m8/odroid_hdmi.h - delete mode 100644 sound/soc/codecs/pcm5102.c - -diff --git a/arch/arm64/boot/dts/meson64_odroidc2.dts b/arch/arm64/boot/dts/meson64_odroidc2.dts -old mode 100755 -new mode 100644 -index 5f64ee3..e95be6a ---- a/arch/arm64/boot/dts/meson64_odroidc2.dts -+++ b/arch/arm64/boot/dts/meson64_odroidc2.dts -@@ -529,21 +529,24 @@ - "usb0_to_ddr"; - }; - -+ /* AUDIO MESON8 DEVICES */ - i2s_dai: I2S { -- compatible = "amlogic, aml-i2s-dai"; -- #sound-dai-cells = <0>; -- resets = <&clock GCLK_IDX_AIU_AI_TOP_GLUE -- &clock GCLK_IDX_AUD_BUF_ABD -- &clock GCLK_IDX_AIU_I2S_OUT -- &clock GCLK_IDX_AIU_AMCLK_MEASURE -- &clock GCLK_IDX_AIU_AIFIFO2 -- &clock GCLK_IDX_AIU_AUD_MIXER -- &clock GCLK_IDX_AIU_MIXER_REG -- &clock GCLK_IDX_AIU_ADC -- &clock GCLK_IDX_AIU_TOP_LEVEL -- &clock GCLK_IDX_AIU_AOCLK -- &clock GCLK_IDX_AUD_IN>; -- reset-names = "top_glue", -+ #sound-dai-cells = <0>; -+ resets = < -+ &clock GCLK_IDX_AIU_AI_TOP_GLUE -+ &clock GCLK_IDX_AUD_BUF_ABD -+ &clock GCLK_IDX_AIU_I2S_OUT -+ &clock GCLK_IDX_AIU_AMCLK_MEASURE -+ &clock GCLK_IDX_AIU_AIFIFO2 -+ &clock GCLK_IDX_AIU_AUD_MIXER -+ &clock GCLK_IDX_AIU_MIXER_REG -+ &clock GCLK_IDX_AIU_ADC -+ &clock GCLK_IDX_AIU_TOP_LEVEL -+ &clock GCLK_IDX_AIU_AOCLK -+ &clock GCLK_IDX_AUD_IN -+ >; -+ reset-names = -+ "top_glue", - "aud_buf", - "i2s_out", - "amclk_measure", -@@ -556,51 +559,46 @@ - "aud_in"; - clocks = <&clock CLK_MPLL0>, - <&clock CLK_AMCLK>; -- clock-names = "mpll0", -- "mclk"; -- }; -- -- i2s_plat: i2s_platform { -- compatible = "amlogic, aml-i2s"; -+ clock-names = "mpll0", "mclk"; -+ compatible = "amlogic, aml-i2s-dai"; - }; -- - spdif_dai: SPDIF { -- compatible = "amlogic, aml-spdif-dai"; -- #sound-dai-cells = <0>; -- resets = <&clock GCLK_IDX_AIU_IEC958 -- &clock GCLK_IDX_AIU_ICE958_AMCLK>; -- reset-names = "iec958", -- "iec958_amclk"; -- clocks = <&clock CLK_MPLL1>, -- <&clock CLK_I958>, -- <&clock CLK_AMCLK>, -- <&clock CLK_SPDIF>; -- clock-names = "mpll1", -- "i958", -- "mclk", -- "spdif"; -- }; -- -- spdif_codec: spdif_codec{ - #sound-dai-cells = <0>; -- compatible = "amlogic, aml-spdif-codec"; -- pinctrl-names = "aml_audio_spdif"; -- pinctrl-0 = <&audio_spdif_pins>; -+ compatible = "amlogic, aml-spdif-dai"; -+ resets = < -+ &clock GCLK_IDX_AIU_IEC958 -+ &clock GCLK_IDX_AIU_ICE958_AMCLK -+ >; -+ reset-names = -+ "iec958", -+ "iec958_amclk"; -+ clocks = <&clock CLK_MPLL1>, -+ <&clock CLK_I958>, -+ <&clock CLK_AMCLK>, -+ <&clock CLK_SPDIF>; -+ clock-names = "mpll1", "i958", "mclk", "spdif"; - }; -- - pcm_dai: PCM { - #sound-dai-cells = <0>; - compatible = "amlogic, aml-pcm-dai"; - }; -- -+ i2s_plat: i2s_platform { -+ compatible = "amlogic, aml-i2s"; -+ }; - pcm_plat: pcm_platform { - compatible = "amlogic, aml-pcm"; - }; -- -+ spdif_codec: spdif_codec{ -+ #sound-dai-cells = <0>; -+ compatible = "amlogic, aml-spdif-codec"; -+ pinctrl-names = "aml_audio_spdif"; -+ pinctrl-0 = <&audio_spdif_pins>; -+ }; - pcm_codec: pcm_codec{ - #sound-dai-cells = <0>; - compatible = "amlogic, pcm2BT-codec"; - }; -+ /* endof AUDIO MESON8 DEVICES */ - - /* AUDIO board specific */ - dummy_codec:dummy{ -@@ -608,43 +606,40 @@ - compatible = "amlogic, aml_dummy_codec"; - status = "okay"; - }; -- -- pcm5102_codec:pcm5102{ -- #sound-dai-cells = <0>; -- compatible = "hardkernel, pcm5102"; -- status = "okay"; -- }; -- -- odroid_hdmi { -- compatible = "sound_card, odroid_hdmi"; -- status = "okay"; -- aml-sound-card,format = "i2s"; -- aml_sound_card,name = "ODROID-HDMI"; -- cpu_list = <&i2sdai0>; -- codec_list = <&dit0>; -- plat_list = <&i2s_plat>; -- i2sdai0: i2sdai0 { -- sound-dai = <&i2s_dai>; -- }; -- dit0: dit0 { -- sound-dai = <&spdif_codec>; -- }; -- }; -- odroid_dac { -- compatible = "sound_card, odroid_dac"; -+ aml_m8_snd { -+ compatible = "aml, aml_snd_m8"; - status = "okay"; - aml-sound-card,format = "i2s"; -- aml_sound_card,name = "ODROID-DAC"; -- pinctrl-names = "aml_snd_i2s"; -+ aml_sound_card,name = "AML-M8AUDIO"; -+ aml,audio-routing = -+ "Ext Spk","LOUTL", -+ "Ext Spk","LOUTR"; -+ -+ mute_gpio-gpios = <&gpio GPIOH_3 0>; -+ hp_disable; -+ hp_paraments = <800 300 0 5 1>; -+ pinctrl-names = "aml_snd_m8"; - pinctrl-0 = <&audio_pins>; -- cpu_list = <&cpudai0>; -- codec_list = <&codec0>; -- plat_list = <&i2s_plat>; -+ cpu_list = <&cpudai0 &cpudai1 &cpudai2>; -+ codec_list = <&codec0 &codec1 &codec2>; -+ plat_list = <&i2s_plat &i2s_plat &pcm_plat>; - cpudai0: cpudai0 { - sound-dai = <&i2s_dai>; - }; -+ cpudai1: cpudai1 { -+ sound-dai = <&spdif_dai>; -+ }; -+ cpudai2: cpudai2 { -+ sound-dai = <&pcm_dai>; -+ }; - codec0: codec0 { -- sound-dai = <&pcm5102_codec>; -+ sound-dai = <&dummy_codec>; -+ }; -+ codec1: codec1 { -+ sound-dai = <&spdif_codec>; -+ }; -+ codec2: codec2 { -+ sound-dai = <&pcm_codec>; - }; - }; - /* END OF AUDIO board specific */ -diff --git a/arch/arm64/configs/odroidc2_defconfig b/arch/arm64/configs/odroidc2_defconfig -index 079f956..08de48b 100644 ---- a/arch/arm64/configs/odroidc2_defconfig -+++ b/arch/arm64/configs/odroidc2_defconfig -@@ -3237,8 +3237,8 @@ CONFIG_SOUND_OSS_CORE_PRECLAIM=y - CONFIG_SND=y - CONFIG_SND_TIMER=y - CONFIG_SND_PCM=y --CONFIG_SND_HWDEP=m --CONFIG_SND_RAWMIDI=m -+CONFIG_SND_HWDEP=y -+CONFIG_SND_RAWMIDI=y - CONFIG_SND_COMPRESS_OFFLOAD=y - CONFIG_SND_JACK=y - CONFIG_SND_SEQUENCER=m -@@ -3272,7 +3272,7 @@ CONFIG_SND_DRIVERS=y - # CONFIG_SND_AC97_POWER_SAVE is not set - CONFIG_SND_SPI=y - CONFIG_SND_USB=y --CONFIG_SND_USB_AUDIO=m -+CONFIG_SND_USB_AUDIO=y - CONFIG_SND_USB_UA101=m - CONFIG_SND_USB_CAIAQ=m - CONFIG_SND_USB_CAIAQ_INPUT=y -@@ -3282,12 +3282,10 @@ CONFIG_SND_SOC=y - # CONFIG_SND_ATMEL_SOC is not set - # CONFIG_SND_DESIGNWARE_I2S is not set - CONFIG_SND_AML_M8_SOC=y --# CONFIG_SND_AML_M8 is not set --CONFIG_SND_ODROID_HDMI=y --CONFIG_SND_ODROID_DAC=m - # CONFIG_SND_AML_G9TV is not set - CONFIG_SND_SOC_I2C_AND_SPI=y --CONFIG_SND_SOC_PCM5102=m -+CONFIG_SND_SOC_DUMMY_CODEC=y -+CONFIG_SND_SOC_PCM2BT=y - # CONFIG_SND_SIMPLE_CARD is not set - # CONFIG_SOUND_PRIME is not set - CONFIG_AC97_BUS=m -diff --git a/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_main.c b/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_main.c -index f53f0e4..e6d04dd 100644 ---- a/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_main.c -+++ b/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_main.c -@@ -1664,7 +1664,7 @@ static int hdmi_task_handle(void *data) - INIT_WORK(&hdmitx_device->work_internal_intr, - hdmitx_internal_intr_handler); - -- /*hdmitx_device->tx_aud_cfg = 1;*/ /* default audio configure is on */ -+ hdmitx_device->tx_aud_cfg = 1; /* default audio configure is on */ - if (init_flag & INIT_FLAG_POWERDOWN) { - /* power down */ - hdmitx_device->HWOp.SetDispMode(hdmitx_device, NULL); -diff --git a/include/sound/pcm.h b/include/sound/pcm.h -index 1f1cdef..f589388 100644 ---- a/include/sound/pcm.h -+++ b/include/sound/pcm.h -@@ -126,8 +126,6 @@ struct snd_pcm_ops { - #define SNDRV_PCM_RATE_96000 (1<<10) /* 96000Hz */ - #define SNDRV_PCM_RATE_176400 (1<<11) /* 176400Hz */ - #define SNDRV_PCM_RATE_192000 (1<<12) /* 192000Hz */ --#define SNDRV_PCM_RATE_352800 (1<<13) /* 352800Hz */ --#define SNDRV_PCM_RATE_384000 (1<<14) /* 384000Hz */ - - #define SNDRV_PCM_RATE_CONTINUOUS (1<<30) /* continuous range */ - #define SNDRV_PCM_RATE_KNOT (1<<31) /* supports more non-continuos rates */ -@@ -140,9 +138,6 @@ struct snd_pcm_ops { - SNDRV_PCM_RATE_88200|SNDRV_PCM_RATE_96000) - #define SNDRV_PCM_RATE_8000_192000 (SNDRV_PCM_RATE_8000_96000|SNDRV_PCM_RATE_176400|\ - SNDRV_PCM_RATE_192000) --#define SNDRV_PCM_RATE_8000_384000 (SNDRV_PCM_RATE_8000_192000|\ -- SNDRV_PCM_RATE_352800|\ -- SNDRV_PCM_RATE_384000) - - #define _SNDRV_PCM_FMTBIT(fmt) (1ULL << (__force int)SNDRV_PCM_FORMAT_##fmt) - #define SNDRV_PCM_FMTBIT_S8 _SNDRV_PCM_FMTBIT(S8) -diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c -index b3406f3..8238722 100644 ---- a/sound/core/pcm_native.c -+++ b/sound/core/pcm_native.c -@@ -1786,8 +1786,7 @@ static int snd_pcm_hw_rule_sample_bits(struct snd_pcm_hw_params *params, - #endif - - static unsigned int rates[] = { 5512, 8000, 11025, 16000, 22050, 32000, 44100, -- 48000, 64000, 88200, 96000, 176400, 192000, -- 352800, 384000 }; -+ 48000, 64000, 88200, 96000, 176400, 192000 }; - - const struct snd_pcm_hw_constraint_list snd_pcm_known_rates = { - .count = ARRAY_SIZE(rates), -diff --git a/sound/soc/aml/m8/Kconfig b/sound/soc/aml/m8/Kconfig -index 4adfb7d..d182291 100644 ---- a/sound/soc/aml/m8/Kconfig -+++ b/sound/soc/aml/m8/Kconfig -@@ -11,15 +11,6 @@ menuconfig SND_AML_M8 - # select SND_SOC_AMLPMU4 if AML1220 - # select SND_SOC_ES8323 - --menuconfig SND_ODROID_HDMI -- tristate "ODROID-SND-HDMI card" -- depends on SND_AML_M8_SOC -- --menuconfig SND_ODROID_DAC -- tristate "ODROID-SND-DAC card" -- depends on SND_AML_M8_SOC -- select SND_SOC_PCM5102 -- - menuconfig SND_AML_G9TV - tristate "AML-SND-G9TV Board" - depends on SND_AML_M8_SOC && SWITCH -diff --git a/sound/soc/aml/m8/Makefile b/sound/soc/aml/m8/Makefile -index 2ed8755..e6bfba1 100644 ---- a/sound/soc/aml/m8/Makefile -+++ b/sound/soc/aml/m8/Makefile -@@ -24,12 +24,6 @@ obj-$(CONFIG_SND_AML_M8_SOC) += snd-soc-aml-spdif-codec.o - snd-soc-aml-m8-objs := aml_m8.o - obj-$(CONFIG_SND_AML_M8) += snd-soc-aml-m8.o - --#ODROID Machine support --snd-soc-odroid-hdmi-objs := odroid_hdmi.o --snd-soc-odroid-dac-objs := odroid_dac.o --obj-$(CONFIG_SND_ODROID_HDMI) += snd-soc-odroid-hdmi.o --obj-$(CONFIG_SND_ODROID_DAC) += snd-soc-odroid-dac.o -- - #AML G9TV Machine support - snd-soc-aml-g9tv-objs := aml_g9tv.o - obj-$(CONFIG_SND_AML_G9TV) += snd-soc-aml-g9tv.o -diff --git a/sound/soc/aml/m8/aml_audio_hw.c b/sound/soc/aml/m8/aml_audio_hw.c -index 09054a2..33268a2 100644 ---- a/sound/soc/aml/m8/aml_audio_hw.c -+++ b/sound/soc/aml/m8/aml_audio_hw.c -@@ -576,21 +576,16 @@ void audio_util_set_dac_i2s_format(unsigned format) - aml_write_cbus(AIU_I2S_SOURCE_DESC, 0x0001); - } - --/* set sclk and lrclk, mclk = 256fs. if srate > 192000, than mclk = 128fs.*/ --void audio_set_i2s_clk_div(int srate) -+/* set sclk and lrclk, mclk = 256fs. */ -+void audio_set_i2s_clk_div(void) - { - /* aiclk source */ - aml_cbus_update_bits(AIU_CLK_CTRL, 1 << 10, 1 << 10); - /* Set mclk over sclk ratio */ - aml_cbus_update_bits(AIU_CLK_CTRL_MORE, 0x3f << 8, (4 - 1) << 8); - /* set dac/adc lrclk ratio over sclk----64fs */ -- if (srate > 192000) { -- aml_cbus_update_bits(AIU_CODEC_DAC_LRCLK_CTRL, 0xfff, (32 - 1)); -- aml_cbus_update_bits(AIU_CODEC_ADC_LRCLK_CTRL, 0xfff, (32 - 1)); -- } else { -- aml_cbus_update_bits(AIU_CODEC_DAC_LRCLK_CTRL, 0xfff, (64 - 1)); -- aml_cbus_update_bits(AIU_CODEC_ADC_LRCLK_CTRL, 0xfff, (64 - 1)); -- } -+ aml_cbus_update_bits(AIU_CODEC_DAC_LRCLK_CTRL, 0xfff, (64 - 1)); -+ aml_cbus_update_bits(AIU_CODEC_ADC_LRCLK_CTRL, 0xfff, (64 - 1)); - /* Enable sclk */ - aml_cbus_update_bits(AIU_CLK_CTRL_MORE, 1 << 14, 1 << 14); - } -diff --git a/sound/soc/aml/m8/aml_audio_hw.h b/sound/soc/aml/m8/aml_audio_hw.h -index d394150..90aee90 100644 ---- a/sound/soc/aml/m8/aml_audio_hw.h -+++ b/sound/soc/aml/m8/aml_audio_hw.h -@@ -126,7 +126,7 @@ unsigned int audio_in_i2s_rd_ptr(void); - unsigned int audio_in_i2s_wr_ptr(void); - unsigned int audio_in_spdif_wr_ptr(void); - void audio_set_i2s_mode(u32 mode); --void audio_set_i2s_clk_div(int srate); -+void audio_set_i2s_clk_div(void); - void audio_set_spdif_clk_div(void); - void audio_enable_ouput(int flag); - unsigned int read_i2s_rd_ptr(void); -diff --git a/sound/soc/aml/m8/aml_i2s.c b/sound/soc/aml/m8/aml_i2s.c -index 95ca2e5..64bed25 100644 ---- a/sound/soc/aml/m8/aml_i2s.c -+++ b/sound/soc/aml/m8/aml_i2s.c -@@ -93,17 +93,17 @@ static const struct snd_pcm_hardware aml_i2s_hardware = { - SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | - SNDRV_PCM_FMTBIT_S32_LE, - -- .period_bytes_min = 32, -+ .period_bytes_min = 64, - .period_bytes_max = 32 * 1024 * 2, - .periods_min = 2, -- .periods_max = 256, -- .buffer_bytes_max = 32 * 1024 * 2, -+ .periods_max = 1024, -+ .buffer_bytes_max = 128 * 1024 * 2 * 2, - - .rate_min = 8000, -- .rate_max = 384000, -- .channels_min = 1, -+ .rate_max = 48000, -+ .channels_min = 2, - .channels_max = 8, -- .fifo_size = 32, -+ .fifo_size = 0, - }; - - static const struct snd_pcm_hardware aml_i2s_capture = { -@@ -116,7 +116,7 @@ static const struct snd_pcm_hardware aml_i2s_capture = { - .period_bytes_min = 64, - .period_bytes_max = 32 * 1024, - .periods_min = 2, -- .periods_max = 256, -+ .periods_max = 1024, - .buffer_bytes_max = 64 * 1024, - - .rate_min = 8000, -@@ -582,23 +582,6 @@ static int aml_i2s_close(struct snd_pcm_substream *substream) - /* extern void audio_hw_958_enable(unsigned flag); */ - /* extern int kernel_android_50; */ - --static char *get_hw_buf_ptr(struct snd_pcm_runtime *runtime, -- snd_pcm_uframes_t cur_pos, int align) --{ -- unsigned int tot_bytes_per_channel = -- frames_to_bytes(runtime, cur_pos) / runtime->channels; -- unsigned int bytes_aligned_per_channel = -- frames_to_bytes(runtime, align / runtime->channels); -- unsigned int hw_base_off = -- tot_bytes_per_channel / bytes_aligned_per_channel; -- unsigned int block_off = -- tot_bytes_per_channel % bytes_aligned_per_channel; -- -- return runtime->dma_area + -- (frames_to_bytes(runtime, align) * hw_base_off) + -- block_off; --} -- - static int aml_i2s_copy_playback(struct snd_pcm_runtime *runtime, int channel, - snd_pcm_uframes_t pos, - void __user *buf, snd_pcm_uframes_t count, -@@ -629,32 +612,48 @@ static int aml_i2s_copy_playback(struct snd_pcm_runtime *runtime, int channel, - return -EFAULT; - if (access_ok(VERIFY_READ, buf, frames_to_bytes(runtime, count))) { - if (runtime->format == SNDRV_PCM_FORMAT_S16_LE) { -+ - int16_t *tfrom, *to, *left, *right; - tfrom = (int16_t *) ubuf; -+ to = (int16_t *) hwbuf; -+ -+ left = to; -+ right = to + 16; -+ if (pos % align) { -+ pr_info("audio data unligned: pos=%d, n=%d, align=%d\n", -+ (int)pos, n, align); -+ } - -- for (j = 0; j < count; j++) { -- to = (int16_t *) get_hw_buf_ptr(runtime, -- pos + j, -- align); -- left = to; -- right = to + align; -- *left = (*tfrom++); -- *right = (*tfrom++); -+ for (j = 0; j < n; j += 64) { -+ for (i = 0; i < 16; i++) { -+ *left++ = (*tfrom++); -+ *right++ = (*tfrom++); -+ } -+ left += 16; -+ right += 16; - } -- } else if (runtime->format == SNDRV_PCM_FORMAT_S24_LE) { -+ } else if (runtime->format == SNDRV_PCM_FORMAT_S24_LE -+ && I2S_MODE == AIU_I2S_MODE_PCM24) { - int32_t *tfrom, *to, *left, *right; - tfrom = (int32_t *) ubuf; -+ to = (int32_t *) hwbuf; - -- for (j = 0; j < count; j++) { -- to = (int32_t *) get_hw_buf_ptr(runtime, -- pos + j, -- align); -- left = to; -- right = to + align; -+ left = to; -+ right = to + 8; - -- *left = (*tfrom++); -- *right = (*tfrom++); -+ if (pos % align) { -+ pr_info("audio data unaligned: pos=%d, n=%d, align=%d\n", -+ (int)pos, n, align); - } -+ for (j = 0; j < n; j += 64) { -+ for (i = 0; i < 8; i++) { -+ *left++ = (*tfrom++); -+ *right++ = (*tfrom++); -+ } -+ left += 8; -+ right += 8; -+ } -+ - } else if (runtime->format == SNDRV_PCM_FORMAT_S32_LE) { - int32_t *tfrom, *to, *left, *right; - tfrom = (int32_t *) ubuf; -@@ -779,6 +778,8 @@ static int aml_i2s_copy_capture(struct snd_pcm_runtime *runtime, int channel, - left += 8; - right += 8; - } -+ /* clean hw buffer */ -+ memset(hwbuf, 0, n * 2); - } - } - res = copy_to_user(buf, ubuf, n); -diff --git a/sound/soc/aml/m8/aml_i2s_dai.c b/sound/soc/aml/m8/aml_i2s_dai.c -index 7f86c32..5dfbaf1 100644 ---- a/sound/soc/aml/m8/aml_i2s_dai.c -+++ b/sound/soc/aml/m8/aml_i2s_dai.c -@@ -43,7 +43,6 @@ - #include "aml_i2s.h" - #include "aml_audio_hw.h" - #include --#include - #include "aml_spdif_dai.h" - - struct aml_dai_info dai_info[3] = { {0} }; -@@ -64,7 +63,6 @@ static int i2s_pos_sync; - /* extern int set_i2s_iec958_samesource(int enable); */ - #define DEFAULT_SAMPLERATE 48000 - #define DEFAULT_MCLK_RATIO_SR 256 --#define MCLK_RATIO_128FS_SR 128 - static int i2sbuf[32 + 16]; - static void aml_i2s_play(void) - { -@@ -138,6 +136,8 @@ static int aml_dai_i2s_startup(struct snd_pcm_substream *substream, - static void aml_dai_i2s_shutdown(struct snd_pcm_substream *substream, - struct snd_soc_dai *dai) - { -+ if (IEC958_mode_codec == 0) -+ aml_spdif_play(); - return; - } - -@@ -164,7 +164,7 @@ static int aml_i2s_set_amclk(struct aml_i2s *i2s, unsigned long rate) - return ret; - } - -- audio_set_i2s_clk_div(i2s->old_samplerate); -+ audio_set_i2s_clk_div(); - - return 0; - } -@@ -219,19 +219,8 @@ static int aml_dai_i2s_trigger(struct snd_pcm_substream *substream, int cmd, - struct snd_soc_dai *dai) - { - struct snd_pcm_runtime *rtd = substream->runtime; -- struct snd_soc_pcm_runtime *prtd = substream->private_data; -- struct snd_soc_dai *codec_dai = prtd->codec_dai; - int *ppp = NULL; -- bool hdmi_out = false; -- - ALSA_TRACE(); -- -- if (!strncmp(codec_dai->name, "dit-hifi", strlen("dit-hifi"))) { -- hdmi_out = true; -- } else { -- hdmi_out = false; -- } -- - switch (cmd) { - case SNDRV_PCM_TRIGGER_START: - case SNDRV_PCM_TRIGGER_RESUME: -@@ -240,16 +229,9 @@ static int aml_dai_i2s_trigger(struct snd_pcm_substream *substream, int cmd, - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { - pr_info("aiu i2s playback enable\n"); - audio_out_i2s_enable(1); -- if (hdmi_out) { -- aml_audio_i2s_mute(); -- hdmitx_audio_mute_op(1); -- if (IEC958_mode_codec == 0) { -- pr_info("audio_hw_958_enable 1\n"); -- audio_hw_958_enable(1); -- } -- } else { -- aml_audio_i2s_unmute(); -- hdmitx_audio_mute_op(0); -+ if (IEC958_mode_codec == 0) { -+ pr_info("audio_hw_958_enable 1\n"); -+ audio_hw_958_enable(1); - } - } else { - audio_in_i2s_enable(1); -@@ -289,10 +271,7 @@ static int aml_dai_i2s_hw_params(struct snd_pcm_substream *substream, - srate = params_rate(params); - if (i2s->old_samplerate != srate) { - i2s->old_samplerate = srate; -- if (srate > 192000) -- mclk_rate = srate * MCLK_RATIO_128FS_SR; -- else -- mclk_rate = srate * DEFAULT_MCLK_RATIO_SR; -+ mclk_rate = srate * DEFAULT_MCLK_RATIO_SR; - aml_i2s_set_amclk(i2s, mclk_rate); - } - -@@ -325,25 +304,27 @@ static int aml_dai_set_i2s_sysclk(struct snd_soc_dai *dai, - return 0; - } - --#ifdef CONFIG_PM - static int aml_dai_i2s_suspend(struct snd_soc_dai *dai) - { -- ALSA_TRACE(); -+ struct aml_i2s *i2s = dev_get_drvdata(dai->dev); -+ -+ if (i2s && i2s->clk_mclk) -+ clk_disable_unprepare(i2s->clk_mclk); -+ - return 0; - } - - static int aml_dai_i2s_resume(struct snd_soc_dai *dai) - { -- ALSA_TRACE(); -+ struct aml_i2s *i2s = dev_get_drvdata(dai->dev); -+ -+ if (i2s && i2s->clk_mclk) -+ clk_prepare_enable(i2s->clk_mclk); -+ - return 0; - } - --#else /* CONFIG_PM */ --#define aml_dai_i2s_suspend NULL --#define aml_dai_i2s_resume NULL --#endif /* CONFIG_PM */ -- --#define AML_DAI_I2S_RATES (SNDRV_PCM_RATE_8000_384000) -+#define AML_DAI_I2S_RATES (SNDRV_PCM_RATE_8000_192000) - #define AML_DAI_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\ - SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) - -diff --git a/sound/soc/aml/m8/aml_m8.c b/sound/soc/aml/m8/aml_m8.c -index 7744375..2012bba 100644 ---- a/sound/soc/aml/m8/aml_m8.c -+++ b/sound/soc/aml/m8/aml_m8.c -@@ -626,6 +626,7 @@ static int aml_m8_audio_probe(struct platform_device *pdev) - - snd_soc_card_set_drvdata(card, p_aml_audio); - card->dev = dev; -+ platform_set_drvdata(pdev, card); - ret = snd_soc_of_parse_card_name(card, "aml_sound_card,name"); - if (ret < 0) { - dev_err(dev, "no specific snd_soc_card name\n"); -@@ -678,6 +679,7 @@ static struct platform_driver aml_m8_audio_driver = { - .name = DRV_NAME, - .owner = THIS_MODULE, - .of_match_table = amlogic_audio_of_match, -+ .pm = &snd_soc_pm_ops, - }, - .probe = aml_m8_audio_probe, - }; -diff --git a/sound/soc/aml/m8/aml_spdif_codec.c b/sound/soc/aml/m8/aml_spdif_codec.c -index 73223b1..5ef287b 100644 ---- a/sound/soc/aml/m8/aml_spdif_codec.c -+++ b/sound/soc/aml/m8/aml_spdif_codec.c -@@ -26,7 +26,7 @@ - - #define DRV_NAME "spdif-dit" - --#define STUB_RATES SNDRV_PCM_RATE_8000_384000 -+#define STUB_RATES SNDRV_PCM_RATE_8000_192000 - #define STUB_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ - SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) - -diff --git a/sound/soc/aml/m8/aml_spdif_dai.c b/sound/soc/aml/m8/aml_spdif_dai.c -index f80c5e9..7b42d2d 100644 ---- a/sound/soc/aml/m8/aml_spdif_dai.c -+++ b/sound/soc/aml/m8/aml_spdif_dai.c -@@ -73,12 +73,15 @@ struct aml_spdif { - int old_samplerate; - }; - struct aml_spdif *spdif_p; --/* -+unsigned int clk81 = 0; -+EXPORT_SYMBOL(clk81); -+ - static int iec958buf[32 + 16]; --*/ -+static int old_samplerate = -1; -+ - void aml_spdif_play(void) - { --#if 0 -+#if 1 - struct _aiu_958_raw_setting_t set; - struct _aiu_958_channel_status_t chstat; - struct snd_pcm_substream substream; -@@ -96,12 +99,28 @@ void aml_spdif_play(void) - set.chan_stat->chstat1_l = 0X200; - set.chan_stat->chstat1_r = 0X200; - audio_hw_958_enable(0); -- if (last_iec_clock != AUDIO_CLK_FREQ_48) { -- ALSA_PRINT("enterd %s,set_clock:%d,sample_rate=%d\n", __func__, -- last_iec_clock, AUDIO_CLK_FREQ_48); -- last_iec_clock = AUDIO_CLK_FREQ_48; -- audio_set_958_clk(AUDIO_CLK_FREQ_48, AUDIO_CLK_256FS); -+ if (old_samplerate != AUDIO_CLK_FREQ_48) { -+ pr_info("enterd %s,set_clock:%d,sample_rate=%d\n", -+ __func__, old_samplerate, AUDIO_CLK_FREQ_48); -+ old_samplerate = AUDIO_CLK_FREQ_48; -+ aml_set_spdif_clk(48000 * 512, 0); -+ } -+ /* Todo, div can be changed, for most case, div = 2 */ -+ /* audio_set_spdif_clk_div(); */ -+ /* 958 divisor: 0=no div; 1=div by 2; 2=div by 3; 3=div by 4. */ -+ if (IEC958_mode_codec == 4 || IEC958_mode_codec == 5 || -+ IEC958_mode_codec == 7 || IEC958_mode_codec == 8) { -+ pr_info("set 4x audio clk for 958\n"); -+ aml_cbus_update_bits(AIU_CLK_CTRL, 3 << 4, 0 << 4); -+ } else if (0) { -+ pr_info("share the same clock\n"); -+ aml_cbus_update_bits(AIU_CLK_CTRL, 3 << 4, 1 << 4); -+ } else { -+ pr_info("set normal 512 fs /4 fs\n"); -+ aml_cbus_update_bits(AIU_CLK_CTRL, 3 << 4, 3 << 4); - } -+ /* enable 958 divider */ -+ aml_cbus_update_bits(AIU_CLK_CTRL, 1 << 1, 1 << 1); - audio_util_set_dac_958_format(AUDIO_ALGOUT_DAC_FORMAT_DSP); - memset(iec958buf, 0, sizeof(iec958buf)); - audio_set_958outbuf((virt_to_phys(iec958buf) + 63) & (~63), 128, 0); -@@ -237,7 +256,26 @@ void aml_hw_iec958_init(struct snd_pcm_substream *substream) - runtime->rate, sample_rate); - /* int srate; */ - /* srate = params_rate(params); */ -- aml_set_spdif_clk(runtime->rate * 512, 0); -+ if (old_samplerate != sample_rate) { -+ old_samplerate = sample_rate; -+ aml_set_spdif_clk(runtime->rate * 512, 0); -+ } -+ /* Todo, div can be changed, for most case, div = 2 */ -+ /* audio_set_spdif_clk_div(); */ -+ /* 958 divisor: 0=no div; 1=div by 2; 2=div by 3; 3=div by 4. */ -+ if (IEC958_mode_codec == 4 || IEC958_mode_codec == 5 || -+ IEC958_mode_codec == 7 || IEC958_mode_codec == 8) { -+ pr_info("set 4x audio clk for 958\n"); -+ aml_cbus_update_bits(AIU_CLK_CTRL, 3 << 4, 0 << 4); -+ } else if (0) { -+ pr_info("share the same clock\n"); -+ aml_cbus_update_bits(AIU_CLK_CTRL, 3 << 4, 1 << 4); -+ } else { -+ pr_info("set normal 512 fs /4 fs\n"); -+ aml_cbus_update_bits(AIU_CLK_CTRL, 3 << 4, 3 << 4); -+ } -+ /* enable 958 divider */ -+ aml_cbus_update_bits(AIU_CLK_CTRL, 1 << 1, 1 << 1); - audio_util_set_dac_958_format(AUDIO_ALGOUT_DAC_FORMAT_DSP); - /*clear the same source function as new raw data output */ - audio_i2s_958_same_source(0); -@@ -357,7 +395,12 @@ void aml_hw_iec958_init(struct snd_pcm_substream *substream) - aml_write_cbus(AIU_958_CHSTAT_L1, 0x900); - aml_write_cbus(AIU_958_CHSTAT_R0, 0x1902); - aml_write_cbus(AIU_958_CHSTAT_R1, 0x900); -- aout_notifier_call_chain(AOUT_EVENT_RAWDATA_MAT_MLP, substream); -+ if (IEC958_mode_codec == 8) -+ aout_notifier_call_chain(AOUT_EVENT_RAWDATA_DTS_HD_MA, -+ substream); -+ else -+ aout_notifier_call_chain(AOUT_EVENT_RAWDATA_MAT_MLP, -+ substream); - } else { - aout_notifier_call_chain(AOUT_EVENT_IEC_60958_PCM, substream); - } -@@ -508,22 +551,6 @@ int aml_set_spdif_clk(unsigned long rate, bool src_i2s) - } - } - -- /* Todo, div can be changed, for most case, div = 2 */ -- /* audio_set_spdif_clk_div(); */ -- /* 958 divisor: 0=no div; 1=div by 2; 2=div by 3; 3=div by 4. */ -- if (IEC958_mode_codec == 4 || IEC958_mode_codec == 5 || -- IEC958_mode_codec == 7 || IEC958_mode_codec == 8) { -- pr_info("set 4x audio clk for 958\n"); -- aml_cbus_update_bits(AIU_CLK_CTRL, 3 << 4, 0 << 4); -- } else if (src_i2s) { -- pr_info("share the same clock\n"); -- aml_cbus_update_bits(AIU_CLK_CTRL, 3 << 4, 1 << 4); -- } else { -- pr_info("set normal 512 fs /4 fs\n"); -- aml_cbus_update_bits(AIU_CLK_CTRL, 3 << 4, 3 << 4); -- } -- /* enable 958 divider */ -- aml_cbus_update_bits(AIU_CLK_CTRL, 1 << 1, 1 << 1); - return 0; - } - -@@ -540,24 +567,27 @@ static int aml_dai_spdif_hw_params(struct snd_pcm_substream *substream, - return 0; - } - --#ifdef CONFIG_PM - static int aml_dai_spdif_suspend(struct snd_soc_dai *cpu_dai) - { -- ALSA_TRACE(); -+ struct aml_spdif *spdif_priv = dev_get_drvdata(cpu_dai->dev); -+ - aml_spdif_play_stop(); -+ if (spdif_priv && spdif_priv->clk_spdif) -+ clk_disable_unprepare(spdif_priv->clk_spdif); -+ - return 0; - } - - static int aml_dai_spdif_resume(struct snd_soc_dai *cpu_dai) - { -- ALSA_TRACE(); -- aml_spdif_play(); -+ struct aml_spdif *spdif_priv = dev_get_drvdata(cpu_dai->dev); -+ -+ /*aml_spdif_play();*/ -+ if (spdif_priv && spdif_priv->clk_spdif) -+ clk_prepare_enable(spdif_priv->clk_spdif); -+ - return 0; - } --#else --#define aml_spdif_suspend NULL --#define aml_spdif_resume NULL --#endif - - static struct snd_soc_dai_ops spdif_dai_ops = { - .set_sysclk = aml_dai_spdif_set_sysclk, -@@ -660,6 +690,18 @@ static int aml_dai_spdif_probe(struct platform_device *pdev) - goto err; - } - -+ ret = clk_set_parent(spdif_priv->clk_i958, spdif_priv->clk_mpl1); -+ if (ret) { -+ pr_err("Can't set i958 clk parent: %d\n", ret); -+ return ret; -+ } -+ -+ ret = clk_set_parent(spdif_priv->clk_spdif, spdif_priv->clk_i958); -+ if (ret) { -+ pr_err("Can't set spdif clk parent: %d\n", ret); -+ return ret; -+ } -+ - ret = clk_prepare_enable(spdif_priv->clk_spdif); - if (ret) { - pr_err("Can't enable spdif clock: %d\n", ret); -diff --git a/sound/soc/aml/m8/aml_spdif_dai.h b/sound/soc/aml/m8/aml_spdif_dai.h -index 8fe56ca..fd11637 100644 ---- a/sound/soc/aml/m8/aml_spdif_dai.h -+++ b/sound/soc/aml/m8/aml_spdif_dai.h -@@ -33,7 +33,7 @@ - #define AOUT_EVENT_RAWDATA_MAT_MLP 0xC - #define AOUT_EVENT_RAWDATA_DST 0xD - #define AOUT_EVENT_RAWDATA_WMA_PRO 0xE -- -+#define AOUT_EVENT_RAWDATA_DTS_HD_MA (AOUT_EVENT_RAWDATA_DTS_HD|(1<<8)) - extern unsigned int IEC958_mode_codec; - - /* -@@ -47,5 +47,5 @@ extern unsigned int IEC958_mode_codec; - */ - void aml_hw_iec958_init(struct snd_pcm_substream *substream); - int aml_set_spdif_clk(unsigned long rate, bool src_i2s); -- -+void aml_spdif_play(void); - #endif /* _AML_SPDIF_DAI_H */ -diff --git a/sound/soc/aml/m8/odroid_dac.c b/sound/soc/aml/m8/odroid_dac.c -deleted file mode 100644 -index aaf8fbd..0000000 ---- a/sound/soc/aml/m8/odroid_dac.c -+++ /dev/null -@@ -1,292 +0,0 @@ --/* -- * sound/soc/aml/m8/aml_m8.c -- * -- * Copyright (C) 2015 Amlogic, Inc. All rights reserved. -- * -- * This program is free software; 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. -- * --*/ -- --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --#include --#include --#include --/* #include */ --#include --#include --/* #include */ --#include -- --/* #include "aml_i2s_dai.h" */ --#include "aml_i2s.h" --#include "odroid_dac.h" --#include "aml_audio_hw.h" --#include --#include --#include --#include --#include --#include --#define DRV_NAME "odroid_dac_snd" --/* extern struct device *spdif_dev; */ -- --static int aml_suspend_pre(struct snd_soc_card *card) --{ -- pr_info(KERN_INFO "enter %s\n", __func__); -- return 0; --} -- --static int aml_suspend_post(struct snd_soc_card *card) --{ -- pr_info(KERN_INFO "enter %s\n", __func__); -- /* if(ext_codec) */ -- /* i2s_gpio_set(card); */ -- return 0; --} -- --static int aml_resume_pre(struct snd_soc_card *card) --{ -- pr_info(KERN_INFO "enter %s\n", __func__); -- -- return 0; --} -- --static int aml_resume_post(struct snd_soc_card *card) --{ -- pr_info(KERN_INFO "enter %s\n", __func__); -- return 0; --} -- --static void aml_i2s_pinmux_init(struct snd_soc_card *card) --{ -- struct odroid_audio_private_data *p_aml_audio; -- -- p_aml_audio = snd_soc_card_get_drvdata(card); -- -- p_aml_audio->pin_ctl = -- devm_pinctrl_get_select(card->dev, "aml_snd_i2s"); -- if (IS_ERR(p_aml_audio->pin_ctl)) -- pr_info("%s,aml_i2s_pinmux_init error!\n", __func__); --} -- --static int aml_card_dai_parse_of(struct device *dev, -- struct snd_soc_dai_link *dai_link, -- int (*init)(struct snd_soc_pcm_runtime *rtd), -- struct device_node *cpu_node, -- struct device_node *codec_node, -- struct device_node *plat_node) --{ -- int ret; -- -- /* get cpu dai->name */ -- ret = snd_soc_of_get_dai_name(cpu_node, &dai_link->cpu_dai_name); -- if (ret < 0) -- goto parse_error; -- -- /* get codec dai->name */ -- ret = snd_soc_of_get_dai_name(codec_node, &dai_link->codec_dai_name); -- if (ret < 0) -- goto parse_error; -- -- dai_link->name = dai_link->stream_name = dai_link->cpu_dai_name; -- dai_link->codec_of_node = of_parse_phandle(codec_node, "sound-dai", 0); -- dai_link->platform_of_node = plat_node; -- dai_link->init = init; -- -- return 0; -- -- parse_error: -- return ret; --} -- --static int aml_card_dais_parse_of(struct snd_soc_card *card) --{ -- struct device_node *np = card->dev->of_node; -- struct device_node *cpu_node, *codec_node, *plat_node; -- struct device *dev = card->dev; -- struct snd_soc_dai_link *dai_links; -- int num_dai_links, cpu_num, codec_num, plat_num; -- int i, ret; -- int (*init)(struct snd_soc_pcm_runtime *rtd); -- -- ret = of_count_phandle_with_args(np, "cpu_list", NULL); -- if (ret < 0) { -- dev_err(dev, "AML sound card no cpu_list errno: %d\n", ret); -- goto err; -- } else { -- cpu_num = ret; -- } -- ret = of_count_phandle_with_args(np, "codec_list", NULL); -- if (ret < 0) { -- dev_err(dev, "AML sound card no codec_list errno: %d\n", ret); -- goto err; -- } else { -- codec_num = ret; -- } -- ret = of_count_phandle_with_args(np, "plat_list", NULL); -- if (ret < 0) { -- dev_err(dev, "AML sound card no plat_list errno: %d\n", ret); -- goto err; -- } else { -- plat_num = ret; -- } -- if ((cpu_num == codec_num) && (cpu_num == plat_num)) { -- num_dai_links = cpu_num; -- } else { -- dev_err(dev, -- "AML sound card cpu_dai num, codec_dai num, platform num don't match: %d\n", -- ret); -- ret = -EINVAL; -- goto err; -- } -- -- dai_links = -- devm_kzalloc(dev, num_dai_links * sizeof(struct snd_soc_dai_link), -- GFP_KERNEL); -- if (!dai_links) { -- dev_err(dev, "Can't allocate snd_soc_dai_links\n"); -- ret = -ENOMEM; -- goto err; -- } -- card->dai_link = dai_links; -- card->num_links = num_dai_links; -- for (i = 0; i < num_dai_links; i++) { -- init = NULL; -- /* CPU sub-node */ -- cpu_node = of_parse_phandle(np, "cpu_list", i); -- if (cpu_node < 0) { -- dev_err(dev, "parse aml sound card cpu list error\n"); -- return -EINVAL; -- } -- /* CODEC sub-node */ -- codec_node = of_parse_phandle(np, "codec_list", i); -- if (codec_node < 0) { -- dev_err(dev, "parse aml sound card codec list error\n"); -- return ret; -- } -- /* Platform sub-node */ -- plat_node = of_parse_phandle(np, "plat_list", i); -- if (plat_node < 0) { -- dev_err(dev, -- "parse aml sound card platform list error\n"); -- return ret; -- } -- -- ret = -- aml_card_dai_parse_of(dev, &dai_links[i], init, cpu_node, -- codec_node, plat_node); -- } -- -- err: -- return ret; --} -- --static int odroid_dac_probe(struct platform_device *pdev) --{ -- struct device *dev = &pdev->dev; -- struct snd_soc_card *card; -- struct odroid_audio_private_data *p_aml_audio; -- int ret; -- -- p_aml_audio = -- devm_kzalloc(dev, sizeof(struct odroid_audio_private_data), -- GFP_KERNEL); -- if (!p_aml_audio) { -- dev_err(&pdev->dev, "Can't allocate odroid_audio_private_data\n"); -- ret = -ENOMEM; -- goto err; -- } -- -- card = devm_kzalloc(dev, sizeof(struct snd_soc_card), GFP_KERNEL); -- if (!card) { -- dev_err(dev, "Can't allocate snd_soc_card\n"); -- ret = -ENOMEM; -- goto err; -- } -- -- snd_soc_card_set_drvdata(card, p_aml_audio); -- card->dev = dev; -- ret = snd_soc_of_parse_card_name(card, "aml_sound_card,name"); -- if (ret < 0) { -- dev_err(dev, "no specific snd_soc_card name\n"); -- goto err; -- } -- -- ret = aml_card_dais_parse_of(card); -- if (ret < 0) { -- dev_err(dev, "parse aml sound card routing error %d\n", -- ret); -- goto err; -- } -- -- card->suspend_pre = aml_suspend_pre, -- card->suspend_post = aml_suspend_post, -- card->resume_pre = aml_resume_pre, -- card->resume_post = aml_resume_post, -- ret = devm_snd_soc_register_card(&pdev->dev, card); -- if (ret < 0) { -- dev_err(dev, "register aml sound card error %d\n", ret); -- goto err; -- } -- -- aml_i2s_pinmux_init(card); -- return 0; -- err: -- dev_err(dev, "Can't probe snd_soc_card\n"); -- return ret; --} -- --static const struct of_device_id odroid_dac_of_match[] = { -- {.compatible = "sound_card, odroid_dac",}, -- {}, --}; -- --static struct platform_driver odroid_dac_audio_driver = { -- .driver = { -- .name = DRV_NAME, -- .owner = THIS_MODULE, -- .of_match_table = odroid_dac_of_match, -- }, -- .probe = odroid_dac_probe, --}; -- --static int __init odroid_audio_init(void) --{ -- return platform_driver_register(&odroid_dac_audio_driver); --} -- --static void __exit odroid_audio_exit(void) --{ -- platform_driver_unregister(&odroid_dac_audio_driver); --} -- --#ifdef CONFIG_DEFERRED_MODULE_INIT --deferred_module_init(odroid_audio_init); --#else --module_init(odroid_audio_init); --#endif --module_exit(odroid_audio_exit); -- --MODULE_AUTHOR("Hardkernel, Inc."); --MODULE_DESCRIPTION("ODROID audio machine Asoc driver"); --MODULE_LICENSE("GPL"); --MODULE_ALIAS("platform:" DRV_NAME); -diff --git a/sound/soc/aml/m8/odroid_hdmi.c b/sound/soc/aml/m8/odroid_hdmi.c -deleted file mode 100644 -index bfa83ec..0000000 ---- a/sound/soc/aml/m8/odroid_hdmi.c -+++ /dev/null -@@ -1,262 +0,0 @@ --/* -- * sound/soc/aml/m8/aml_m8.c -- * -- * Copyright (C) 2015 Amlogic, Inc. All rights reserved. -- * -- * This program is free software; 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. -- * --*/ -- --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --#include --#include --#include --/* #include */ --#include --#include --/* #include */ --#include -- --/* #include "aml_i2s_dai.h" */ --#include "aml_i2s.h" --#include "odroid_hdmi.h" --#include "aml_audio_hw.h" --#include --#include --#include --#include --#include --#include --#define DRV_NAME "odroid_hdmi_snd" --/* extern struct device *spdif_dev; */ -- --static int aml_suspend_pre(struct snd_soc_card *card) --{ -- pr_info(KERN_INFO "enter %s\n", __func__); -- return 0; --} -- --static int aml_suspend_post(struct snd_soc_card *card) --{ -- pr_info(KERN_INFO "enter %s\n", __func__); -- return 0; --} -- --static int aml_resume_pre(struct snd_soc_card *card) --{ -- pr_info(KERN_INFO "enter %s\n", __func__); -- return 0; --} -- --static int aml_resume_post(struct snd_soc_card *card) --{ -- pr_info(KERN_INFO "enter %s\n", __func__); -- return 0; --} -- --static int aml_card_dai_parse_of(struct device *dev, -- struct snd_soc_dai_link *dai_link, -- int (*init)(struct snd_soc_pcm_runtime *rtd), -- struct device_node *cpu_node, -- struct device_node *codec_node, -- struct device_node *plat_node) --{ -- int ret; -- -- /* get cpu dai->name */ -- ret = snd_soc_of_get_dai_name(cpu_node, &dai_link->cpu_dai_name); -- if (ret < 0) -- goto parse_error; -- -- /* get codec dai->name */ -- ret = snd_soc_of_get_dai_name(codec_node, &dai_link->codec_dai_name); -- if (ret < 0) -- goto parse_error; -- -- dai_link->name = dai_link->stream_name = dai_link->cpu_dai_name; -- dai_link->codec_of_node = of_parse_phandle(codec_node, "sound-dai", 0); -- dai_link->platform_of_node = plat_node; -- dai_link->init = init; -- -- return 0; -- -- parse_error: -- return ret; --} -- --static int aml_card_dais_parse_of(struct snd_soc_card *card) --{ -- struct device_node *np = card->dev->of_node; -- struct device_node *cpu_node, *codec_node, *plat_node; -- struct device *dev = card->dev; -- struct snd_soc_dai_link *dai_links; -- int num_dai_links, cpu_num, codec_num, plat_num; -- int i, ret; -- int (*init)(struct snd_soc_pcm_runtime *rtd); -- -- ret = of_count_phandle_with_args(np, "cpu_list", NULL); -- if (ret < 0) { -- dev_err(dev, "AML sound card no cpu_list errno: %d\n", ret); -- goto err; -- } else { -- cpu_num = ret; -- } -- ret = of_count_phandle_with_args(np, "codec_list", NULL); -- if (ret < 0) { -- dev_err(dev, "AML sound card no codec_list errno: %d\n", ret); -- goto err; -- } else { -- codec_num = ret; -- } -- ret = of_count_phandle_with_args(np, "plat_list", NULL); -- if (ret < 0) { -- dev_err(dev, "AML sound card no plat_list errno: %d\n", ret); -- goto err; -- } else { -- plat_num = ret; -- } -- if ((cpu_num == codec_num) && (cpu_num == plat_num)) { -- num_dai_links = cpu_num; -- } else { -- dev_err(dev, -- "AML sound card cpu_dai num, codec_dai num, platform num don't match: %d\n", -- ret); -- ret = -EINVAL; -- goto err; -- } -- -- dai_links = -- devm_kzalloc(dev, num_dai_links * sizeof(struct snd_soc_dai_link), -- GFP_KERNEL); -- if (!dai_links) { -- dev_err(dev, "Can't allocate snd_soc_dai_links\n"); -- ret = -ENOMEM; -- goto err; -- } -- card->dai_link = dai_links; -- card->num_links = num_dai_links; -- for (i = 0; i < num_dai_links; i++) { -- init = NULL; -- /* CPU sub-node */ -- cpu_node = of_parse_phandle(np, "cpu_list", i); -- if (cpu_node < 0) { -- dev_err(dev, "parse aml sound card cpu list error\n"); -- return -EINVAL; -- } -- /* CODEC sub-node */ -- codec_node = of_parse_phandle(np, "codec_list", i); -- if (codec_node < 0) { -- dev_err(dev, "parse aml sound card codec list error\n"); -- return ret; -- } -- /* Platform sub-node */ -- plat_node = of_parse_phandle(np, "plat_list", i); -- if (plat_node < 0) { -- dev_err(dev, -- "parse aml sound card platform list error\n"); -- return ret; -- } -- -- ret = -- aml_card_dai_parse_of(dev, &dai_links[i], init, cpu_node, -- codec_node, plat_node); -- } -- -- err: -- return ret; --} -- --static int odroid_hdmi_probe(struct platform_device *pdev) --{ -- struct device *dev = &pdev->dev; -- struct snd_soc_card *card; -- struct hdmi_audio_private_data *p_hdmi_audio; -- int ret; -- -- p_hdmi_audio = -- devm_kzalloc(dev, sizeof(struct hdmi_audio_private_data), -- GFP_KERNEL); -- if (!p_hdmi_audio) { -- dev_err(&pdev->dev, "Can't allocate hdmi_audio_private_data\n"); -- ret = -ENOMEM; -- goto err; -- } -- -- card = devm_kzalloc(dev, sizeof(struct snd_soc_card), GFP_KERNEL); -- if (!card) { -- dev_err(dev, "Can't allocate snd_soc_card\n"); -- ret = -ENOMEM; -- goto err; -- } -- -- snd_soc_card_set_drvdata(card, p_hdmi_audio); -- card->dev = dev; -- ret = snd_soc_of_parse_card_name(card, "aml_sound_card,name"); -- if (ret < 0) { -- dev_err(dev, "no specific snd_soc_card name\n"); -- goto err; -- } -- -- ret = aml_card_dais_parse_of(card); -- if (ret < 0) { -- dev_err(dev, "parse aml sound card routing error %d\n", -- ret); -- goto err; -- } -- -- card->suspend_pre = aml_suspend_pre, -- card->suspend_post = aml_suspend_post, -- card->resume_pre = aml_resume_pre, -- card->resume_post = aml_resume_post, -- ret = devm_snd_soc_register_card(&pdev->dev, card); -- if (ret < 0) { -- dev_err(dev, "register aml sound card error %d\n", ret); -- goto err; -- } -- return 0; -- err: -- dev_err(dev, "Can't probe snd_soc_card\n"); -- return ret; --} -- --static const struct of_device_id odroid_hdmi_of_match[] = { -- {.compatible = "sound_card, odroid_hdmi",}, -- {}, --}; -- --MODULE_DEVICE_TABLE(of, odroid_hdmi_dt_match); -- --static struct platform_driver aml_m8_audio_driver = { -- .driver = { -- .name = DRV_NAME, -- .owner = THIS_MODULE, -- .of_match_table = odroid_hdmi_of_match, -- }, -- .probe = odroid_hdmi_probe, --}; -- --module_platform_driver(aml_m8_audio_driver); -- --MODULE_AUTHOR("Hardkernel, Inc."); --MODULE_DESCRIPTION("ODROID audio machine Asoc driver"); --MODULE_LICENSE("GPL"); --MODULE_ALIAS("platform:" DRV_NAME); -diff --git a/sound/soc/aml/m8/odroid_hdmi.h b/sound/soc/aml/m8/odroid_hdmi.h -deleted file mode 100644 -index 7976da0..0000000 ---- a/sound/soc/aml/m8/odroid_hdmi.h -+++ /dev/null -@@ -1,31 +0,0 @@ --/* -- * sound/soc/aml/m8/aml_m8.h -- * -- * Copyright (C) 2015 Amlogic, Inc. All rights reserved. -- * -- * This program is free software; 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. -- * --*/ -- --#ifndef AML_M8_H --#define AML_M8_H -- --#include --#include --struct hdmi_audio_private_data { -- int bias_level; -- void *data; --}; -- --void aml_spdif_pinmux_init(struct device *pdev); --void aml_spdif_pinmux_deinit(struct device *pdev); --#endif -- -diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig -index e9ab5e1..3216f9b 100644 ---- a/sound/soc/codecs/Kconfig -+++ b/sound/soc/codecs/Kconfig -@@ -134,7 +134,6 @@ config SND_SOC_ALL_CODECS - select SND_SOC_WM9713 if SND_SOC_AC97_BUS - select SND_SOC_DUMMY_CODEC - select SND_SOC_PCM2BT -- select SND_SOC_PCM5102 - help - Normally ASoC codec drivers are only built if a machine driver which - uses them is also built since they are only usable with a machine -@@ -563,6 +562,3 @@ config SND_SOC_DUMMY_CODEC - - config SND_SOC_PCM2BT - tristate -- --config SND_SOC_PCM5102 -- tristate -diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile -index 9e024d9..f86b42a 100644 ---- a/sound/soc/codecs/Makefile -+++ b/sound/soc/codecs/Makefile -@@ -126,7 +126,6 @@ snd-soc-wm9713-objs := wm9713.o - snd-soc-wm-hubs-objs := wm_hubs.o - snd-soc-dummy_codec-objs := dummy_codec.o - snd-soc-pcm2bt-objs := pcm2bt.o --snd-soc-pcm5102-objs := pcm5102.o - - # Amp - snd-soc-max9877-objs := max9877.o -@@ -259,7 +258,6 @@ obj-$(CONFIG_SND_SOC_WM_ADSP) += snd-soc-wm-adsp.o - obj-$(CONFIG_SND_SOC_WM_HUBS) += snd-soc-wm-hubs.o - obj-$(CONFIG_SND_SOC_DUMMY_CODEC) += snd-soc-dummy_codec.o - obj-$(CONFIG_SND_SOC_PCM2BT) += snd-soc-pcm2bt.o --obj-$(CONFIG_SND_SOC_PCM5102) += snd-soc-pcm5102.o - - # Amp - obj-$(CONFIG_SND_SOC_MAX9877) += snd-soc-max9877.o -diff --git a/sound/soc/codecs/pcm5102.c b/sound/soc/codecs/pcm5102.c -deleted file mode 100644 -index 2935e39..0000000 ---- a/sound/soc/codecs/pcm5102.c -+++ /dev/null -@@ -1,161 +0,0 @@ --/* -- * amlogic ALSA SoC pcm5102 codec driver -- */ -- --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --struct pcm5102_private { -- struct snd_soc_codec codec; --}; -- --#define PCM5102_RATES (SNDRV_PCM_RATE_8000_384000) --#define PCM5102_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\ -- SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) -- --static int pcm5102_pcm_hw_params(struct snd_pcm_substream *substream, -- struct snd_pcm_hw_params *params, -- struct snd_soc_dai *dai) --{ -- return 0; --} -- --static int pcm5102_set_dai_fmt(struct snd_soc_dai *codec_dai, -- unsigned int fmt) --{ -- return 0; --} -- --static int pcm5102_mute(struct snd_soc_dai *dai, int mute) --{ -- return 0; --} -- --static const struct snd_soc_dapm_widget pcm5102_dapm_widgets[] = { -- /* Output Side */ -- /* DACs */ -- SND_SOC_DAPM_DAC("Left DAC", "HIFI Playback", -- SND_SOC_NOPM, 0, 0), -- SND_SOC_DAPM_DAC("Right DAC", "HIFI Playback", -- SND_SOC_NOPM, 7, 0), -- -- /* Output Lines */ -- SND_SOC_DAPM_OUTPUT("LOUTL"), -- SND_SOC_DAPM_OUTPUT("LOUTR"), -- --}; -- --static const struct snd_soc_dapm_route pcm5102_dapm_routes[] = { -- -- {"LOUTL", NULL, "Left DAC"}, -- {"LOUTR", NULL, "Right DAC"}, --}; -- --static struct snd_soc_dai_ops pcm5102_ops = { -- .hw_params = pcm5102_pcm_hw_params, -- .set_fmt = pcm5102_set_dai_fmt, -- .digital_mute = pcm5102_mute, --}; -- --struct snd_soc_dai_driver pcm5102_dai = { -- .name = "pcm5102", -- .id = 1, -- .playback = { -- .stream_name = "HIFI Playback", -- .channels_min = 2, -- .channels_max = 2, -- .rates = PCM5102_RATES, -- .formats = PCM5102_FORMATS, -- }, -- .ops = &pcm5102_ops, --}; -- --static int pcm5102_probe(struct snd_soc_codec *codec) --{ -- return 0; --} -- --static int pcm5102_remove(struct snd_soc_codec *codec) --{ -- return 0; --}; -- --struct snd_soc_codec_driver soc_codec_dev_pcm5102 = { -- .probe = pcm5102_probe, -- .remove = pcm5102_remove, -- .dapm_widgets = pcm5102_dapm_widgets, -- .num_dapm_widgets = ARRAY_SIZE(pcm5102_dapm_widgets), -- .dapm_routes = pcm5102_dapm_routes, -- .num_dapm_routes = ARRAY_SIZE(pcm5102_dapm_routes), --}; -- --#ifdef CONFIG_OF --static const struct of_device_id amlogic_codec_dt_match[] = { -- {.compatible = "hardkernel, pcm5102", -- }, -- {}, --}; --#else --#define amlogic_codec_dt_match NULL --#endif -- --static int pcm5102_platform_probe(struct platform_device *pdev) --{ -- struct pcm5102_private *pcm5102; -- int ret; -- -- pr_info("pcm5102_platform_probe\n"); -- pcm5102 = kzalloc(sizeof(struct pcm5102_private), GFP_KERNEL); -- if (pcm5102 == NULL) -- return -ENOMEM; -- -- platform_set_drvdata(pdev, pcm5102); -- ret = snd_soc_register_codec(&pdev->dev, &soc_codec_dev_pcm5102, -- &pcm5102_dai, 1); -- -- if (ret < 0) -- kfree(pcm5102); -- -- return ret; --} -- --static int pcm5102_platform_remove(struct platform_device *pdev) --{ -- snd_soc_unregister_codec(&pdev->dev); -- kfree(platform_get_drvdata(pdev)); -- return 0; --} -- --static struct platform_driver pcm5102_platform_driver = { -- .driver = { -- .name = "pcm5102", -- .owner = THIS_MODULE, -- .of_match_table = amlogic_codec_dt_match, -- }, -- .probe = pcm5102_platform_probe, -- .remove = pcm5102_platform_remove, --}; -- --static int __init pcm5102_init(void) --{ -- return platform_driver_register(&pcm5102_platform_driver); --} -- --static void __exit pcm5102_exit(void) --{ -- platform_driver_unregister(&pcm5102_platform_driver); --} -- --module_init(pcm5102_init); --module_exit(pcm5102_exit); -- --MODULE_AUTHOR("AMLogic, Inc."); --MODULE_DESCRIPTION("ASoC pcm5102 driver"); --MODULE_LICENSE("GPL"); --- -1.9.1 - diff --git a/projects/Odroid_C2/patches/linux/linux-001-staging_rtl8712_rtl8712_avoid_lots_of_build_warnings.patch b/projects/Odroid_C2/patches/linux/linux-001-staging_rtl8712_rtl8712_avoid_lots_of_build_warnings.patch new file mode 100644 index 0000000000..0ad0dc7884 --- /dev/null +++ b/projects/Odroid_C2/patches/linux/linux-001-staging_rtl8712_rtl8712_avoid_lots_of_build_warnings.patch @@ -0,0 +1,113 @@ +From fa89009a1869844f9a9360eb07c45d457446ac0e Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 5 Jun 2014 22:48:15 +0200 +Subject: [PATCH] staging: rtl8712, rtl8712: avoid lots of build warnings + +commit 0c9f3a65c5eb7fe1fc611a22eb8a8b71ea865998 upstream. + +The rtl8712 driver has an 'extern inline' function that contains an +'if', which causes lots of warnings with CONFIG_PROFILE_ALL_BRANCHES +overriding the definition of 'if': + +drivers/staging/rtl8712/ieee80211.h:759:229: warning: '______f' is static but declared in inline function 'ieee80211_get_hdrlen' which is not static [enabled by default] + +This changes the driver to use 'static inline' instead, which happens +to be the correct annotation anyway. + +Signed-off-by: Arnd Bergmann +Cc: Larry Finger +Cc: Florian Schilhabel +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/rtl8187se/ieee80211/ieee80211.h | 4 ++-- + drivers/staging/rtl8192u/ieee80211/ieee80211.h | 10 +++++----- + drivers/staging/rtl8712/ieee80211.h | 4 ++-- + 3 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211.h b/drivers/staging/rtl8187se/ieee80211/ieee80211.h +index 09ffd9b..6ebdd3f 100644 +--- a/drivers/staging/rtl8187se/ieee80211/ieee80211.h ++++ b/drivers/staging/rtl8187se/ieee80211/ieee80211.h +@@ -1460,12 +1460,12 @@ extern void ieee80211_sta_ps_send_null_frame(struct ieee80211_device *ieee, + + extern const long ieee80211_wlan_frequencies[]; + +-extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee) ++static inline void ieee80211_increment_scans(struct ieee80211_device *ieee) + { + ieee->scans++; + } + +-extern inline int ieee80211_get_scans(struct ieee80211_device *ieee) ++static inline int ieee80211_get_scans(struct ieee80211_device *ieee) + { + return ieee->scans; + } +diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h +index bc64f05..b1a0380 100644 +--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h ++++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h +@@ -2250,7 +2250,7 @@ static inline void *ieee80211_priv(struct net_device *dev) + return ((struct ieee80211_device *)netdev_priv(dev))->priv; + } + +-extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) ++static inline int ieee80211_is_empty_essid(const char *essid, int essid_len) + { + /* Single white space is for Linksys APs */ + if (essid_len == 1 && essid[0] == ' ') +@@ -2266,7 +2266,7 @@ extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) + return 1; + } + +-extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode) ++static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode) + { + /* + * It is possible for both access points and our device to support +@@ -2292,7 +2292,7 @@ extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mod + return 0; + } + +-extern inline int ieee80211_get_hdrlen(u16 fc) ++static inline int ieee80211_get_hdrlen(u16 fc) + { + int hdrlen = IEEE80211_3ADDR_LEN; + +@@ -2578,12 +2578,12 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee); + + extern const long ieee80211_wlan_frequencies[]; + +-extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee) ++static inline void ieee80211_increment_scans(struct ieee80211_device *ieee) + { + ieee->scans++; + } + +-extern inline int ieee80211_get_scans(struct ieee80211_device *ieee) ++static inline int ieee80211_get_scans(struct ieee80211_device *ieee) + { + return ieee->scans; + } +diff --git a/drivers/staging/rtl8712/ieee80211.h b/drivers/staging/rtl8712/ieee80211.h +index da4000e..8269be8 100644 +--- a/drivers/staging/rtl8712/ieee80211.h ++++ b/drivers/staging/rtl8712/ieee80211.h +@@ -734,7 +734,7 @@ enum ieee80211_state { + #define IEEE_G (1<<2) + #define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) + +-extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) ++static inline int ieee80211_is_empty_essid(const char *essid, int essid_len) + { + /* Single white space is for Linksys APs */ + if (essid_len == 1 && essid[0] == ' ') +@@ -748,7 +748,7 @@ extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) + return 1; + } + +-extern inline int ieee80211_get_hdrlen(u16 fc) ++static inline int ieee80211_get_hdrlen(u16 fc) + { + int hdrlen = 24; + diff --git a/projects/Odroid_C2/patches/linux/linux-002-gcc5-use_gcc_inline_version_instead_c99.patch b/projects/Odroid_C2/patches/linux/linux-002-gcc5-use_gcc_inline_version_instead_c99.patch deleted file mode 100644 index 5d5be45d5f..0000000000 --- a/projects/Odroid_C2/patches/linux/linux-002-gcc5-use_gcc_inline_version_instead_c99.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -Naur a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h ---- a/include/linux/compiler-gcc.h 2016-02-09 12:52:30.000000000 +0100 -+++ b/include/linux/compiler-gcc.h 2016-02-09 21:43:41.133285186 +0100 -@@ -53,9 +53,10 @@ - */ - #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ - !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) --# define inline inline __attribute__((always_inline)) notrace --# define __inline__ __inline__ __attribute__((always_inline)) notrace --# define __inline __inline __attribute__((always_inline)) notrace -+/* XXX: check __GNUC_STDC_INLINE__, fix line length */ -+# define inline inline __attribute__((always_inline)) __attribute__((__gnu_inline__)) -+# define __inline__ __inline__ __attribute__((always_inline)) __attribute__((__gnu_inline__)) -+# define __inline __inline __attribute__((always_inline)) __attribute__((__gnu_inline__)) - #else - /* A lot of inline functions can cause havoc with function tracing */ - # define inline inline notrace diff --git a/projects/Odroid_C2/patches/linux/linux-003-no_dev_console.patch b/projects/Odroid_C2/patches/linux/linux-003-no_dev_console.patch index da6340f875..df35a7ab9a 100644 --- a/projects/Odroid_C2/patches/linux/linux-003-no_dev_console.patch +++ b/projects/Odroid_C2/patches/linux/linux-003-no_dev_console.patch @@ -1,7 +1,8 @@ -diff -Naur a/init/main.c b/init/main.c ---- a/init/main.c 2016-08-22 17:01:25.000000000 +0200 -+++ b/init/main.c 2016-08-22 17:09:48.000000000 +0200 -@@ -915,8 +915,14 @@ +diff --git a/init/main.c b/init/main.c +index 9484f4b..db55edd 100644 +--- a/init/main.c ++++ b/init/main.c +@@ -880,8 +880,14 @@ static noinline void __init kernel_init_freeable(void) do_basic_setup(); /* Open the /dev/console on the rootfs, this should never fail */ diff --git a/projects/Odroid_C2/patches/linux/linux-004-PCM-Audio-add-8CH.feature.patch b/projects/Odroid_C2/patches/linux/linux-004-PCM-Audio-add-8CH.feature.patch deleted file mode 100644 index 63e7745138..0000000000 --- a/projects/Odroid_C2/patches/linux/linux-004-PCM-Audio-add-8CH.feature.patch +++ /dev/null @@ -1,79 +0,0 @@ -From a7d02c5cbc830b1a49d9de7c2941edce3d4f2da0 Mon Sep 17 00:00:00 2001 -From: Zongdong Jiao -Date: Thu, 10 Dec 2015 20:01:32 +0800 -Subject: [PATCH] PD#116527: hdmitx20: add PCM 8ch feature - -Change-Id: I2208275be4c4a9c5442441945f9d4a83099f75ff ---- - drivers/amlogic/hdmi/hdmi_tx_20/hw/hdmi_tx_hw.c | 24 ++++++++++++++++++++---- - 1 file changed, 20 insertions(+), 4 deletions(-) - -diff --git a/drivers/amlogic/hdmi/hdmi_tx_20/hw/hdmi_tx_hw.c b/drivers/amlogic/hdmi/hdmi_tx_20/hw/hdmi_tx_hw.c -index a1dc9e0..f6d1006 100644 ---- a/drivers/amlogic/hdmi/hdmi_tx_20/hw/hdmi_tx_hw.c -+++ b/drivers/amlogic/hdmi/hdmi_tx_20/hw/hdmi_tx_hw.c -@@ -2075,13 +2075,20 @@ static void set_aud_info_pkt(struct hdmitx_dev *hdev, - hdmitx_set_reg_bits(HDMITX_DWC_FC_AUDICONF0, 7, 4, 3); - hdmitx_wr_reg(HDMITX_DWC_FC_AUDICONF2, 0x13); - break; -+ case CT_PCM: -+ hdmitx_set_reg_bits(HDMITX_DWC_FC_AUDICONF0, -+ audio_param->channel_num, 4, 3); -+ if (audio_param->channel_num == 0x7) -+ hdmitx_wr_reg(HDMITX_DWC_FC_AUDICONF2, 0x13); -+ else -+ hdmitx_wr_reg(HDMITX_DWC_FC_AUDICONF2, 0x00); -+ break; - case CT_DTS: - case CT_DTS_HD: - default: - /* CC: 2ch */ - hdmitx_set_reg_bits(HDMITX_DWC_FC_AUDICONF0, 1, 4, 3); - hdmitx_wr_reg(HDMITX_DWC_FC_AUDICONF2, 0x0); -- hdmitx_wr_reg(HDMITX_DWC_FC_AUDICONF2, 0x0); - break; - } - hdmitx_wr_reg(HDMITX_DWC_FC_AUDICONF3, 0); -@@ -2162,6 +2169,14 @@ static void set_aud_samp_pkt(struct hdmitx_dev *hdev, - hdmitx_set_reg_bits(HDMITX_DWC_FC_AUDSCONF, 1, 0, 1); - break; - case CT_PCM: /* AudSamp */ -+ hdmitx_set_reg_bits(HDMITX_DWC_AUD_SPDIF1, 0, 7, 1); -+ hdmitx_set_reg_bits(HDMITX_DWC_AUD_SPDIF1, 0, 6, 1); -+ hdmitx_set_reg_bits(HDMITX_DWC_AUD_SPDIF1, 24, 0, 5); -+ if (audio_param->channel_num == 0x7) -+ hdmitx_set_reg_bits(HDMITX_DWC_FC_AUDSCONF, 1, 0, 1); -+ else -+ hdmitx_set_reg_bits(HDMITX_DWC_FC_AUDSCONF, 0, 0, 1); -+ break; - case CT_AC_3: - case CT_DOLBY_D: - case CT_DTS: -@@ -2171,7 +2186,7 @@ static void set_aud_samp_pkt(struct hdmitx_dev *hdev, - hdmitx_set_reg_bits(HDMITX_DWC_AUD_SPDIF1, 0, 6, 1); - hdmitx_set_reg_bits(HDMITX_DWC_AUD_SPDIF1, 24, 0, 5); - hdmitx_set_reg_bits(HDMITX_DWC_FC_AUDSCONF, 0, 0, 1); -- break; -+ break; - } - } - -@@ -2207,7 +2222,8 @@ static int hdmitx_set_audmode(struct hdmitx_dev *hdev, - tx_aud_src = 0; - pr_info("hdmitx tx_aud_src = %d\n", tx_aud_src); - -- set_hdmi_audio_source(tx_aud_src ? 1 : 2); -+ /* set_hdmi_audio_source(tx_aud_src ? 1 : 2); */ -+ set_hdmi_audio_source(2); - - /* config IP */ - /* Configure audio */ -@@ -3808,7 +3824,7 @@ static void config_hdmi20_tx(enum hdmi_vic vic, - data32 |= (0 << 0); - hdmitx_wr_reg(HDMITX_DWC_FC_AUDICONF1, data32); - -- hdmitx_wr_reg(HDMITX_DWC_FC_AUDICONF2, 0x13); -+ hdmitx_wr_reg(HDMITX_DWC_FC_AUDICONF2, 0x00); - - data32 = 0; - data32 |= (1 << 5); diff --git a/projects/Odroid_C2/patches/linux/linux-006-save-cec-config.patch b/projects/Odroid_C2/patches/linux/linux-006-save-cec-config.patch deleted file mode 100644 index a66b70ff40..0000000000 --- a/projects/Odroid_C2/patches/linux/linux-006-save-cec-config.patch +++ /dev/null @@ -1,85 +0,0 @@ -diff --git a/drivers/amlogic/cec/hdmi_ao_cec.c b/drivers/amlogic/cec/hdmi_ao_cec.c -index 21ca8bb..9f4686f 100644 ---- a/drivers/amlogic/cec/hdmi_ao_cec.c -+++ b/drivers/amlogic/cec/hdmi_ao_cec.c -@@ -225,14 +225,13 @@ unsigned int aocec_rd_reg(unsigned long addr) - { - unsigned int data32; - unsigned long flags; -- waiting_aocec_free(); - spin_lock_irqsave(&cec_dev->cec_reg_lock, flags); -+ waiting_aocec_free(); - data32 = 0; - data32 |= 0 << 16; /* [16] cec_reg_wr */ - data32 |= 0 << 8; /* [15:8] cec_reg_wrdata */ -- data32 |= addr << 0; /* [7:0] cec_reg_addr */ -+ data32 |= (addr & 0xff) << 0; /* [7:0] cec_reg_addr */ - writel(data32, cec_dev->cec_reg + AO_CEC_RW_REG); -- - waiting_aocec_free(); - data32 = ((readl(cec_dev->cec_reg + AO_CEC_RW_REG)) >> 24) & 0xff; - spin_unlock_irqrestore(&cec_dev->cec_reg_lock, flags); -@@ -241,15 +240,16 @@ unsigned int aocec_rd_reg(unsigned long addr) - - void aocec_wr_reg(unsigned long addr, unsigned long data) - { -- unsigned long data32; -+ unsigned int data32; - unsigned long flags; -- waiting_aocec_free(); - spin_lock_irqsave(&cec_dev->cec_reg_lock, flags); -+ waiting_aocec_free(); - data32 = 0; - data32 |= 1 << 16; /* [16] cec_reg_wr */ -- data32 |= data << 8; /* [15:8] cec_reg_wrdata */ -- data32 |= addr << 0; /* [7:0] cec_reg_addr */ -+ data32 |= (data & 0xff) << 8; /* [15:8] cec_reg_wrdata */ -+ data32 |= (addr & 0xff) << 0; /* [7:0] cec_reg_addr */ - writel(data32, cec_dev->cec_reg + AO_CEC_RW_REG); -+ waiting_aocec_free(); - spin_unlock_irqrestore(&cec_dev->cec_reg_lock, flags); - } /* aocec_wr_only_reg */ - -@@ -737,6 +737,8 @@ static void cec_pre_init(void) - { - ao_cec_init(); - -+ cec_config(cec_dev->tx_dev->cec_func_config, 1); -+ - cec_arbit_bit_time_set(3, 0x118, 0); - cec_arbit_bit_time_set(5, 0x000, 0); - cec_arbit_bit_time_set(7, 0x2aa, 0); -@@ -1452,8 +1454,6 @@ static int hdmitx_cec_open(struct inode *inode, struct file *file) - cec_dev->cec_info.open_count++; - if (cec_dev->cec_info.open_count) { - cec_dev->cec_info.hal_ctl = 1; -- /* enable all cec features */ -- cec_config(0x2f, 1); - } - return 0; - } -@@ -1463,8 +1463,6 @@ static int hdmitx_cec_release(struct inode *inode, struct file *file) - cec_dev->cec_info.open_count--; - if (!cec_dev->cec_info.open_count) { - cec_dev->cec_info.hal_ctl = 0; -- /* disable all cec features */ -- cec_config(0x0, 1); - } - return 0; - } -diff --git a/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_main.c b/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_main.c -index 57105b6..0a7f914 100644 ---- a/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_main.c -+++ b/drivers/amlogic/hdmi/hdmi_tx_20/hdmi_tx_main.c -@@ -2467,9 +2467,9 @@ static int __init hdmitx_boot_para_setup(char *s) - init_flag |= INIT_FLAG_NOT_LOAD; - } else if (strncmp(token, "cec", 3) == 0) { - ret = kstrtoul(token+3, 16, &list); -- if ((list >= 0) && (list <= 0x2f)) -+ if ((list >= 0) && (list <= 0xff)) - hdmitx_device.cec_func_config = list; -- hdmi_print(INF, CEC "HDMI hdmi_cec_func_config:0x%x\n", -+ hdmi_print(IMP, CEC "HDMI hdmi_cec_func_config:0x%x\n", - hdmitx_device.cec_func_config); - } else if (strcmp(token, "forcergb") == 0) { - hdmitx_output_rgb(); diff --git a/projects/Odroid_C2/patches/linux/linux-007-sound_soc_aml_m8-Report-only-working-frequecies-and-bit-depths.patch b/projects/Odroid_C2/patches/linux/linux-007-sound_soc_aml_m8-Report-only-working-frequecies-and-bit-depths.patch index 43ba03c43f..d268e5b3ad 100644 --- a/projects/Odroid_C2/patches/linux/linux-007-sound_soc_aml_m8-Report-only-working-frequecies-and-bit-depths.patch +++ b/projects/Odroid_C2/patches/linux/linux-007-sound_soc_aml_m8-Report-only-working-frequecies-and-bit-depths.patch @@ -1,31 +1,15 @@ -From 5b29cd4f629f63a0e594152b49753e36e215ef26 Mon Sep 17 00:00:00 2001 -From: Jamie Coldhill -Date: Fri, 9 Sep 2016 10:33:29 +0800 -Subject: [PATCH] Report only working frequecies and bit depths +From edab2a489829689fdaadb90f1897c948ea3c9020 Mon Sep 17 00:00:00 2001 +From: kszaq +Date: Wed, 3 Jun 2015 10:20:04 +0200 +Subject: [PATCH] sound/soc/aml/m8: Report only working frequecies and bit + depths --- - sound/soc/aml/m8/aml_i2s_dai.c | 5 ++--- sound/soc/aml/m8/aml_spdif_codec.c | 5 ++--- - 2 files changed, 4 insertions(+), 6 deletions(-) + 1 file changed, 2 insertions(+), 3 deletions(-) -diff --git a/sound/soc/aml/m8/aml_i2s_dai.c b/sound/soc/aml/m8/aml_i2s_dai.c -index 5dfbaf1..cc6e5b6 100644 ---- a/sound/soc/aml/m8/aml_i2s_dai.c -+++ b/sound/soc/aml/m8/aml_i2s_dai.c -@@ -324,9 +324,8 @@ static int aml_dai_i2s_resume(struct snd_soc_dai *dai) - return 0; - } - --#define AML_DAI_I2S_RATES (SNDRV_PCM_RATE_8000_192000) --#define AML_DAI_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\ -- SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) -+#define AML_DAI_I2S_RATES SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000 -+#define AML_DAI_I2S_FORMATS SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE - - static struct snd_soc_dai_ops aml_dai_i2s_ops = { - .startup = aml_dai_i2s_startup, diff --git a/sound/soc/aml/m8/aml_spdif_codec.c b/sound/soc/aml/m8/aml_spdif_codec.c -index 5ef287b..85f2833 100644 +index ac76ef6..cf0e929 100644 --- a/sound/soc/aml/m8/aml_spdif_codec.c +++ b/sound/soc/aml/m8/aml_spdif_codec.c @@ -26,9 +26,8 @@ @@ -35,10 +19,40 @@ index 5ef287b..85f2833 100644 -#define STUB_RATES SNDRV_PCM_RATE_8000_192000 -#define STUB_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ - SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) -+#define STUB_RATES SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000 -+#define STUB_FORMATS SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE - - static struct snd_soc_codec_driver soc_codec_spdif_dit; ++#define STUB_RATES SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000 ++#define STUB_FORMATS SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE + struct pinctrl *pin_spdif_ctl; + struct device *spdif_dev; -- -1.9.1 +1.8.3.1 + +From 1e6294498438359c4ac39b2ab563487d750fbaaf Mon Sep 17 00:00:00 2001 +From: kszaq +Date: Tue, 30 Aug 2016 23:31:29 +0200 +Subject: [PATCH] sound/soc/aml/m8: report only working frequencies and bit + depths for I2S + +--- + sound/soc/aml/m8/aml_i2s_dai.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/aml/m8/aml_i2s_dai.c b/sound/soc/aml/m8/aml_i2s_dai.c +index 3626676..d2ebad1 100644 +--- a/sound/soc/aml/m8/aml_i2s_dai.c ++++ b/sound/soc/aml/m8/aml_i2s_dai.c +@@ -290,9 +290,8 @@ static int aml_dai_i2s_resume(struct snd_soc_dai *dai) + return 0; + } + +-#define AML_DAI_I2S_RATES (SNDRV_PCM_RATE_8000_192000) +-#define AML_DAI_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\ +- SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) ++#define AML_DAI_I2S_RATES SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000 ++#define AML_DAI_I2S_FORMATS SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE + + static struct snd_soc_dai_ops aml_dai_i2s_ops = { + .startup = aml_dai_i2s_startup, +-- +1.8.3.1 + diff --git a/projects/Odroid_C2/patches/linux/linux-008-max_freq_dvfs_table.patch b/projects/Odroid_C2/patches/linux/linux-008-max_freq_dvfs_table.patch index c961848a26..78c8305a74 100644 --- a/projects/Odroid_C2/patches/linux/linux-008-max_freq_dvfs_table.patch +++ b/projects/Odroid_C2/patches/linux/linux-008-max_freq_dvfs_table.patch @@ -17,7 +17,7 @@ diff --git a/drivers/amlogic/mailbox/scpi_protocol.c b/drivers/amlogic/mailbox/s index ec787d2..f3aa3e0 100644 --- a/drivers/amlogic/mailbox/scpi_protocol.c +++ b/drivers/amlogic/mailbox/scpi_protocol.c -@@ -129,6 +129,12 @@ static int high_priority_cmds[] = { +@@ -85,6 +85,12 @@ static int high_priority_cmds[] = { SCPI_CMD_SENSOR_CFG_BOUNDS, }; @@ -30,7 +30,7 @@ index ec787d2..f3aa3e0 100644 static struct scpi_opp *scpi_opps[MAX_DVFS_DOMAINS]; static int scpi_linux_errmap[SCPI_ERR_MAX] = { -@@ -267,6 +273,9 @@ struct scpi_opp *scpi_dvfs_get_opps(u8 domain) +@@ -236,6 +242,9 @@ struct scpi_opp *scpi_dvfs_get_opps(u8 domain) struct scpi_opp *opps; size_t opps_sz; int count, ret; @@ -40,7 +40,7 @@ index ec787d2..f3aa3e0 100644 if (domain >= MAX_DVFS_DOMAINS) return ERR_PTR(-EINVAL); -@@ -285,6 +294,27 @@ struct scpi_opp *scpi_dvfs_get_opps(u8 domain) +@@ -254,6 +263,27 @@ struct scpi_opp *scpi_dvfs_get_opps(u8 domain) return ERR_PTR(-ENOMEM); count = DVFS_OPP_COUNT(buf.header); @@ -68,11 +68,10 @@ index ec787d2..f3aa3e0 100644 opps_sz = count * sizeof(*(opps->opp)); opps->count = count; -@@ -416,3 +446,26 @@ int scpi_get_sensor_value(u16 sensor, u32 *val) - return ret; +@@ -422,3 +452,25 @@ int scpi_send_usr_data(u32 client_id, u32 *val, u32 size) } - EXPORT_SYMBOL_GPL(scpi_get_sensor_value); -+ + EXPORT_SYMBOL_GPL(scpi_send_usr_data); + +#if defined(CONFIG_ARCH_MESON64_ODROIDC2) +static int __init get_max_freq(char *str) +{ diff --git a/projects/Odroid_C2/patches/linux/linux-999.13-fix-u64-unknown-type.patch b/projects/Odroid_C2/patches/linux/linux-999.13-fix-u64-unknown-type.patch deleted file mode 100644 index e3c636281a..0000000000 --- a/projects/Odroid_C2/patches/linux/linux-999.13-fix-u64-unknown-type.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur a/arch/arm64/include/uapi/asm/sigcontext.h b/arch/arm64/include/uapi/asm/sigcontext.h ---- a/arch/arm64/include/uapi/asm/sigcontext.h 2016-04-06 23:18:37.000000000 -0700 -+++ b/arch/arm64/include/uapi/asm/sigcontext.h 2016-04-07 16:00:47.870241223 -0700 -@@ -58,7 +58,7 @@ - - struct esr_context { - struct _aarch64_ctx head; -- u64 esr; -+ __u64 esr; - }; - - #endif /* _UAPI__ASM_SIGCONTEXT_H */ diff --git a/projects/Odroid_C2/patches/u-boot/u-boot-0001-set-default-boot-options.patch b/projects/Odroid_C2/patches/u-boot/u-boot-0001-set-default-boot-options.patch index 9c436f60b9..fa1d267fae 100644 --- a/projects/Odroid_C2/patches/u-boot/u-boot-0001-set-default-boot-options.patch +++ b/projects/Odroid_C2/patches/u-boot/u-boot-0001-set-default-boot-options.patch @@ -24,13 +24,12 @@ diff -Naur a/include/configs/odroidc2.h b/include/configs/odroidc2.h #define CONFIG_ENV_SIZE (32 * SZ_1K) /* 32kB */ #define CONFIG_ENV_OFFSET (720 * SZ_1K) /* FIXME: should be close to U-boot image -@@ -176,8 +168,8 @@ +@@ -176,7 +168,7 @@ #define CONFIG_LZO 1 /* storage: emmc/nand/sd */ --#define CONFIG_ENV_OVERWRITE + #define CONFIG_ENV_OVERWRITE -#define CONFIG_ENV_IS_IN_MMC 1 -+//#define CONFIG_ENV_OVERWRITE +#define CONFIG_ENV_IS_IN_MMC 0 #define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_AML_SD_EMMC 1 diff --git a/projects/WeTek_Hub/linux/linux.aarch64.conf b/projects/WeTek_Hub/linux/linux.aarch64.conf index a466d11e12..d9c88584a0 100644 --- a/projects/WeTek_Hub/linux/linux.aarch64.conf +++ b/projects/WeTek_Hub/linux/linux.aarch64.conf @@ -263,8 +263,9 @@ CONFIG_FREEZER=y # # Platform selection # -CONFIG_ARCH_VEXPRESS=y +# CONFIG_ARCH_VEXPRESS is not set # CONFIG_ARCH_XGENE is not set +# CONFIG_ARCH_MESON64_ODROIDC2 is not set # # Bus support From 40cab058daf7d14f2cc3c3ccc8b59a2b483b2fe3 Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Mon, 19 Sep 2016 21:52:29 +0200 Subject: [PATCH 5/7] projects/Odroid_C2: use WeTek Hub patches This moves aarch64 common patches to $PKG_DIR/patches/aarch64 until $DEVICE is supported --- .../aarch64}/libcec-00-aocec-support.patch | 0 ...rtl8712_avoid_lots_of_build_warnings.patch | 0 .../aarch64}/linux-003-no_dev_console.patch | 0 ...ly-working-frequecies-and-bit-depths.patch | 0 ...ackets-completely-when-resampling-to.patch | 0 ...channel-PCM-and-HD-Audio-passthrough.patch | 0 ...framebuffer-size-is-less-than-output.patch | 0 ...0004-powermanagement-disable-suspend.patch | 0 ...er-hide-meaningless-skips-from-users.patch | 0 .../kodi-0006-fix-resolution-fallback.patch | 0 .../eventlircd-0001-without-werror.patch | 11 - .../kodi/kodi-0001-enable-OMX_PTS64.patch | 25 - .../kodi/kodi-0001-owersun-odroid.patch | 730 ---------------- ...channel-PCM-and-HD-Audio-passthrough.patch | 102 --- ...0004-powermanagement-disable-suspend.patch | 13 - .../libcec/libcec-00-aocec-support.patch | 803 ------------------ ...e_sampling_freqencies_and_bit_depths.patch | 58 -- .../patches/linux/no_dev_console.patch | 21 - ...rtl8712_avoid_lots_of_build_warnings.patch | 113 --- 19 files changed, 1876 deletions(-) rename {projects/Odroid_C2/patches/libcec => packages/devel/libcec/patches/aarch64}/libcec-00-aocec-support.patch (100%) rename {projects/Odroid_C2/patches/linux => packages/linux/patches/aarch64}/linux-001-staging_rtl8712_rtl8712_avoid_lots_of_build_warnings.patch (100%) rename {projects/Odroid_C2/patches/linux => packages/linux/patches/aarch64}/linux-003-no_dev_console.patch (100%) rename {projects/Odroid_C2/patches/linux => packages/linux/patches/aarch64}/linux-007-sound_soc_aml_m8-Report-only-working-frequecies-and-bit-depths.patch (100%) rename projects/WeTek_Hub/patches/kodi/0001-aml-Fill-audio-packets-completely-when-resampling-to.patch => packages/mediacenter/kodi/patches/aarch64/kodi-0001-aml-Fill-audio-packets-completely-when-resampling-to.patch (100%) rename projects/WeTek_Hub/patches/kodi/0002-aml-Multichannel-PCM-and-HD-Audio-passthrough.patch => packages/mediacenter/kodi/patches/aarch64/kodi-0002-aml-Multichannel-PCM-and-HD-Audio-passthrough.patch (100%) rename projects/WeTek_Hub/patches/kodi/0003-EGLNativeTypeAmlogic-Enable-GUI-free_scale-when-framebuffer-size-is-less-than-output.patch => packages/mediacenter/kodi/patches/aarch64/kodi-0003-EGLNativeTypeAmlogic-Enable-GUI-free_scale-when-framebuffer-size-is-less-than-output.patch (100%) rename projects/Odroid_C2/patches/kodi/kodi-0002-disable-suspend.patch => packages/mediacenter/kodi/patches/aarch64/kodi-0004-powermanagement-disable-suspend.patch (100%) rename projects/WeTek_Hub/patches/kodi/0005-aml-FIX-renderer-hide-meaningless-skips-from-users.patch => packages/mediacenter/kodi/patches/aarch64/kodi-0005-aml-FIX-renderer-hide-meaningless-skips-from-users.patch (100%) rename projects/WeTek_Hub/patches/kodi/0006-fix-resolution-fallback.patch => packages/mediacenter/kodi/patches/aarch64/kodi-0006-fix-resolution-fallback.patch (100%) delete mode 100644 projects/Odroid_C2/patches/eventlircd/eventlircd-0001-without-werror.patch delete mode 100644 projects/Odroid_C2/patches/kodi/kodi-0001-enable-OMX_PTS64.patch delete mode 100644 projects/Odroid_C2/patches/kodi/kodi-0001-owersun-odroid.patch delete mode 100644 projects/Odroid_C2/patches/kodi/kodi-0004-Multichannel-PCM-and-HD-Audio-passthrough.patch delete mode 100644 projects/WeTek_Hub/patches/kodi/0004-powermanagement-disable-suspend.patch delete mode 100644 projects/WeTek_Hub/patches/libcec/libcec-00-aocec-support.patch delete mode 100644 projects/WeTek_Hub/patches/linux/limit_avaiable_sampling_freqencies_and_bit_depths.patch delete mode 100644 projects/WeTek_Hub/patches/linux/no_dev_console.patch delete mode 100644 projects/WeTek_Hub/patches/linux/staging_rtl8712_rtl8712_avoid_lots_of_build_warnings.patch diff --git a/projects/Odroid_C2/patches/libcec/libcec-00-aocec-support.patch b/packages/devel/libcec/patches/aarch64/libcec-00-aocec-support.patch similarity index 100% rename from projects/Odroid_C2/patches/libcec/libcec-00-aocec-support.patch rename to packages/devel/libcec/patches/aarch64/libcec-00-aocec-support.patch diff --git a/projects/Odroid_C2/patches/linux/linux-001-staging_rtl8712_rtl8712_avoid_lots_of_build_warnings.patch b/packages/linux/patches/aarch64/linux-001-staging_rtl8712_rtl8712_avoid_lots_of_build_warnings.patch similarity index 100% rename from projects/Odroid_C2/patches/linux/linux-001-staging_rtl8712_rtl8712_avoid_lots_of_build_warnings.patch rename to packages/linux/patches/aarch64/linux-001-staging_rtl8712_rtl8712_avoid_lots_of_build_warnings.patch diff --git a/projects/Odroid_C2/patches/linux/linux-003-no_dev_console.patch b/packages/linux/patches/aarch64/linux-003-no_dev_console.patch similarity index 100% rename from projects/Odroid_C2/patches/linux/linux-003-no_dev_console.patch rename to packages/linux/patches/aarch64/linux-003-no_dev_console.patch diff --git a/projects/Odroid_C2/patches/linux/linux-007-sound_soc_aml_m8-Report-only-working-frequecies-and-bit-depths.patch b/packages/linux/patches/aarch64/linux-007-sound_soc_aml_m8-Report-only-working-frequecies-and-bit-depths.patch similarity index 100% rename from projects/Odroid_C2/patches/linux/linux-007-sound_soc_aml_m8-Report-only-working-frequecies-and-bit-depths.patch rename to packages/linux/patches/aarch64/linux-007-sound_soc_aml_m8-Report-only-working-frequecies-and-bit-depths.patch diff --git a/projects/WeTek_Hub/patches/kodi/0001-aml-Fill-audio-packets-completely-when-resampling-to.patch b/packages/mediacenter/kodi/patches/aarch64/kodi-0001-aml-Fill-audio-packets-completely-when-resampling-to.patch similarity index 100% rename from projects/WeTek_Hub/patches/kodi/0001-aml-Fill-audio-packets-completely-when-resampling-to.patch rename to packages/mediacenter/kodi/patches/aarch64/kodi-0001-aml-Fill-audio-packets-completely-when-resampling-to.patch diff --git a/projects/WeTek_Hub/patches/kodi/0002-aml-Multichannel-PCM-and-HD-Audio-passthrough.patch b/packages/mediacenter/kodi/patches/aarch64/kodi-0002-aml-Multichannel-PCM-and-HD-Audio-passthrough.patch similarity index 100% rename from projects/WeTek_Hub/patches/kodi/0002-aml-Multichannel-PCM-and-HD-Audio-passthrough.patch rename to packages/mediacenter/kodi/patches/aarch64/kodi-0002-aml-Multichannel-PCM-and-HD-Audio-passthrough.patch diff --git a/projects/WeTek_Hub/patches/kodi/0003-EGLNativeTypeAmlogic-Enable-GUI-free_scale-when-framebuffer-size-is-less-than-output.patch b/packages/mediacenter/kodi/patches/aarch64/kodi-0003-EGLNativeTypeAmlogic-Enable-GUI-free_scale-when-framebuffer-size-is-less-than-output.patch similarity index 100% rename from projects/WeTek_Hub/patches/kodi/0003-EGLNativeTypeAmlogic-Enable-GUI-free_scale-when-framebuffer-size-is-less-than-output.patch rename to packages/mediacenter/kodi/patches/aarch64/kodi-0003-EGLNativeTypeAmlogic-Enable-GUI-free_scale-when-framebuffer-size-is-less-than-output.patch diff --git a/projects/Odroid_C2/patches/kodi/kodi-0002-disable-suspend.patch b/packages/mediacenter/kodi/patches/aarch64/kodi-0004-powermanagement-disable-suspend.patch similarity index 100% rename from projects/Odroid_C2/patches/kodi/kodi-0002-disable-suspend.patch rename to packages/mediacenter/kodi/patches/aarch64/kodi-0004-powermanagement-disable-suspend.patch diff --git a/projects/WeTek_Hub/patches/kodi/0005-aml-FIX-renderer-hide-meaningless-skips-from-users.patch b/packages/mediacenter/kodi/patches/aarch64/kodi-0005-aml-FIX-renderer-hide-meaningless-skips-from-users.patch similarity index 100% rename from projects/WeTek_Hub/patches/kodi/0005-aml-FIX-renderer-hide-meaningless-skips-from-users.patch rename to packages/mediacenter/kodi/patches/aarch64/kodi-0005-aml-FIX-renderer-hide-meaningless-skips-from-users.patch diff --git a/projects/WeTek_Hub/patches/kodi/0006-fix-resolution-fallback.patch b/packages/mediacenter/kodi/patches/aarch64/kodi-0006-fix-resolution-fallback.patch similarity index 100% rename from projects/WeTek_Hub/patches/kodi/0006-fix-resolution-fallback.patch rename to packages/mediacenter/kodi/patches/aarch64/kodi-0006-fix-resolution-fallback.patch diff --git a/projects/Odroid_C2/patches/eventlircd/eventlircd-0001-without-werror.patch b/projects/Odroid_C2/patches/eventlircd/eventlircd-0001-without-werror.patch deleted file mode 100644 index a3443c2e10..0000000000 --- a/projects/Odroid_C2/patches/eventlircd/eventlircd-0001-without-werror.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Naur a/configure.ac b/configure.ac ---- a/configure.ac 2016-02-10 07:28:43.854521022 +0100 -+++ b/configure.ac 2016-02-10 07:42:40.195015151 +0100 -@@ -126,7 +126,6 @@ - AX_C_CHECK_FLAG([-pedantic],[],[],[CFLAGS="$CFLAGS -pedantic"],[]) - AX_C_CHECK_FLAG([-flto],[],[],[CFLAGS="$CFLAGS -flto"],[]) - AX_C_CHECK_FLAG([-fvisibility=hidden],[],[],[CFLAGS="$CFLAGS -fvisibility=hidden"],[]) --AX_C_CHECK_FLAG([-Werror],[],[],[CFLAGS="$CFLAGS -Werror"],[]) - AX_C_CHECK_FLAG([-Wall],[],[],[CFLAGS="$CFLAGS -Wall"],[]) - AX_C_CHECK_FLAG([-Wextra],[],[],[CFLAGS="$CFLAGS -Wextra"],[]) - AX_C_CHECK_FLAG([-Wcast-qual],[],[],[CFLAGS="$CFLAGS -Wcast-qual"],[]) diff --git a/projects/Odroid_C2/patches/kodi/kodi-0001-enable-OMX_PTS64.patch b/projects/Odroid_C2/patches/kodi/kodi-0001-enable-OMX_PTS64.patch deleted file mode 100644 index b7812f7a02..0000000000 --- a/projects/Odroid_C2/patches/kodi/kodi-0001-enable-OMX_PTS64.patch +++ /dev/null @@ -1,25 +0,0 @@ -From be8eb87a89b6d074c16b6d4d138bfe0ff16aa663 Mon Sep 17 00:00:00 2001 -From: Markus Pfau -Date: Wed, 24 Aug 2016 19:16:24 +0200 -Subject: [PATCH] OMX_PTS type decision by sizeof(long) - ---- - xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp -index ca8e964..e384711 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp -@@ -1895,7 +1895,7 @@ int CAMLCodec::DequeueBuffer(int64_t &pts) - // Since kernel 3.14 Amlogic changed length and units of PTS values reported here. - // To differentiate such PTS values we check for existence of omx_pts_interval_lower - // parameter, because it was introduced since kernel 3.14. -- if (access("/sys/module/amvideo/parameters/omx_pts_interval_lower", F_OK) != -1) -+ if (1) - { - pts = vbuf.timestamp.tv_sec & 0xFFFFFFFF; - pts <<= 32; --- -1.9.1 - diff --git a/projects/Odroid_C2/patches/kodi/kodi-0001-owersun-odroid.patch b/projects/Odroid_C2/patches/kodi/kodi-0001-owersun-odroid.patch deleted file mode 100644 index db7bfa0b45..0000000000 --- a/projects/Odroid_C2/patches/kodi/kodi-0001-owersun-odroid.patch +++ /dev/null @@ -1,730 +0,0 @@ -From 99f9fb9e1df7f6877bbce3cf90ebf24cacea1797 Mon Sep 17 00:00:00 2001 -From: Markus Pfau -Date: Tue, 23 Aug 2016 00:06:43 +0200 -Subject: [PATCH] oversun-changes - ---- - xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 39 ++++++--- - .../cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp | 13 +-- - xbmc/utils/AMLUtils.cpp | 93 ++++++++++++++++++-- - xbmc/utils/CPUInfo.cpp | 25 +++--- - xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp | 98 ++++++++++++++++------ - xbmc/windowing/egl/EGLNativeTypeAmlogic.h | 19 ++++- - 6 files changed, 221 insertions(+), 66 deletions(-) - -diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp -index 4bb159f..ea2db01 100644 ---- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp -+++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp -@@ -490,6 +490,7 @@ snd_pcm_chmap_t* CAESinkALSA::SelectALSAChannelMap(const CAEChannelInfo& info) - - void CAESinkALSA::GetAESParams(const AEAudioFormat& format, std::string& params) - { -+#if !defined(HAS_LIBAMCODEC) - if (m_passthrough) - params = "AES0=0x06"; - else -@@ -506,6 +507,7 @@ void CAESinkALSA::GetAESParams(const AEAudioFormat& format, std::string& params) - else if (format.m_sampleRate == 44100) params += ",AES3=0x00"; - else if (format.m_sampleRate == 32000) params += ",AES3=0x03"; - else params += ",AES3=0x01"; -+#endif - } - - bool CAESinkALSA::Initialize(AEAudioFormat &format, std::string &device) -@@ -744,16 +746,16 @@ bool CAESinkALSA::InitializeHW(const ALSAConfig &inconfig, ALSAConfig &outconfig - snd_pcm_hw_params_get_buffer_size_max(hw_params, &bufferSize); - snd_pcm_hw_params_get_period_size_max(hw_params, &periodSize, NULL); - -- /* -- We want to make sure, that we have max 200 ms Buffer with -+ /* -+ We want to make sure, that we have max 200 ms Buffer with - a periodSize of approx 50 ms. Choosing a higher bufferSize - will cause problems with menu sounds. Buffer will be increased - after those are fixed. - */ - periodSize = std::min(periodSize, (snd_pcm_uframes_t) sampleRate / 20); - bufferSize = std::min(bufferSize, (snd_pcm_uframes_t) sampleRate / 5); -- -- /* -+ -+ /* - According to upstream we should set buffer size first - so make sure it is always at least - 4x period size to not get underruns (some systems seem to have issues with only 2 periods) - */ -@@ -772,7 +774,7 @@ bool CAESinkALSA::InitializeHW(const ALSAConfig &inconfig, ALSAConfig &outconfig - snd_pcm_hw_params_copy(hw_params_copy, hw_params); // restore working copy - CLog::Log(LOGDEBUG, "CAESinkALSA::InitializeHW - Request: Failed to limit periodSize to %lu", periodSizeMax); - } -- -+ - // first trying bufferSize, PeriodSize - // for more info see here: - // http://mailman.alsa-project.org/pipermail/alsa-devel/2009-September/021069.html -@@ -782,22 +784,24 @@ bool CAESinkALSA::InitializeHW(const ALSAConfig &inconfig, ALSAConfig &outconfig - snd_pcm_uframes_t periodSizeTemp, bufferSizeTemp; - periodSizeTemp = periodSize; - bufferSizeTemp = bufferSize; -- if (snd_pcm_hw_params_set_buffer_size_near(m_pcm, hw_params_copy, &bufferSize) != 0 -- || snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, NULL) != 0 -+ int dir = 0; -+ -+ if (snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, &dir) != 0 -+ || snd_pcm_hw_params_set_buffer_size_near(m_pcm, hw_params_copy, &bufferSize) != 0 - || snd_pcm_hw_params(m_pcm, hw_params_copy) != 0) - { - bufferSize = bufferSizeTemp; - periodSize = periodSizeTemp; - // retry with PeriodSize, bufferSize - snd_pcm_hw_params_copy(hw_params_copy, hw_params); // restore working copy -- if (snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, NULL) != 0 -+ if (snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, &dir) != 0 - || snd_pcm_hw_params_set_buffer_size_near(m_pcm, hw_params_copy, &bufferSize) != 0 - || snd_pcm_hw_params(m_pcm, hw_params_copy) != 0) - { - // try only periodSize - periodSize = periodSizeTemp; - snd_pcm_hw_params_copy(hw_params_copy, hw_params); // restore working copy -- if(snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, NULL) != 0 -+ if(snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, &dir) != 0 - || snd_pcm_hw_params(m_pcm, hw_params_copy) != 0) - { - // try only BufferSize -@@ -819,7 +823,7 @@ bool CAESinkALSA::InitializeHW(const ALSAConfig &inconfig, ALSAConfig &outconfig - snd_pcm_get_params(m_pcm, &bufferSize, &periodSize); - } - } -- -+ - CLog::Log(LOGDEBUG, "CAESinkALSA::InitializeHW - Got: periodSize %lu, bufferSize %lu", periodSize, bufferSize); - - /* set the format parameters */ -@@ -1302,6 +1306,15 @@ void CAESinkALSA::EnumerateDevicesEx(AEDeviceInfoList &list, bool force) - - AEDeviceType CAESinkALSA::AEDeviceTypeFromName(const std::string &name) - { -+ -+#if defined(HAS_LIBAMCODEC) -+ // ugly workaround to show DTS / AC3 caps -+ // but don't run into multi channel issues -+ // as we can only open 2 pcm channels -+ // God, forgive me I wrote this -+ return AE_DEVTYPE_IEC958; -+#endif -+ - if (name.substr(0, 4) == "hdmi") - return AE_DEVTYPE_HDMI; - else if (name.substr(0, 6) == "iec958" || name.substr(0, 5) == "spdif") -@@ -1406,9 +1419,9 @@ void CAESinkALSA::EnumerateDevice(AEDeviceInfoList &list, const std::string &dev - - if (badHDMI) - { -- /* -- * Warn about disconnected devices, but keep them enabled -- * Detection can go wrong on Intel, Nvidia and on all -+ /* -+ * Warn about disconnected devices, but keep them enabled -+ * Detection can go wrong on Intel, Nvidia and on all - * AMD (fglrx) hardware, so it is not safe to close those - * handles - */ -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp -index 5dadf82..ca8e964 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp -@@ -398,7 +398,7 @@ void dumpfile_write(am_private_t *para, void* buf, int bufsiz) - } - - if (para->dumpdemux && para->dumpfile != -1) -- write(para->dumpfile, buf, bufsiz); -+ int ret = write(para->dumpfile, buf, bufsiz); - } - - static vformat_t codecid_to_vformat(enum AVCodecID id) -@@ -713,7 +713,7 @@ int write_av_packet(am_private_t *para, am_packet_t *pkt) - } - pkt->newflag = 0; - } -- -+ - buf = pkt->data; - size = pkt->data_size ; - if (size == 0 && pkt->isvalid) { -@@ -1563,7 +1563,7 @@ bool CAMLCodec::OpenDecoder(CDVDStreamInfo &hints) - // h264 in an avi file - if (m_hints.ptsinvalid) - am_private->gcodec.param = (void*)(EXTERNAL_PTS | SYNC_OUTSIDE); -- break; -+ break; - case VFORMAT_REAL: - am_private->stream_type = AM_STREAM_RM; - am_private->vcodec.noblock = 1; -@@ -1628,7 +1628,7 @@ bool CAMLCodec::OpenDecoder(CDVDStreamInfo &hints) - - Create(); - -- m_display_rect = CRect(0, 0, CDisplaySettings::GetInstance().GetCurrentResolutionInfo().iWidth, CDisplaySettings::GetInstance().GetCurrentResolutionInfo().iHeight); -+ m_display_rect = CRect(0, 0, CDisplaySettings::GetInstance().GetCurrentResolutionInfo().iScreenWidth, CDisplaySettings::GetInstance().GetCurrentResolutionInfo().iScreenHeight); - - std::string strScaler; - SysfsUtils::GetString("/sys/class/ppmgr/ppscaler", strScaler); -@@ -2154,7 +2154,6 @@ void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect) - int diff = (int) ((dst_rect.Height() - dst_rect.Width()) / 2); - dst_rect = CRect(DestRect.x1 - diff, DestRect.y1, DestRect.x2 + diff, DestRect.y2); - } -- - } - - if (m_dst_rect != dst_rect) -@@ -2176,7 +2175,7 @@ void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect) - #ifdef TARGET_ANDROID - display = m_display_rect; - #else -- display = gui; -+ display = CRect(0, 0, CDisplaySettings::GetInstance().GetCurrentResolutionInfo().iScreenWidth, CDisplaySettings::GetInstance().GetCurrentResolutionInfo().iScreenHeight);; - #endif - if (gui != display) - { -@@ -2248,6 +2247,8 @@ void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect) - std::string s_gui = StringUtils::Format("%i,%i,%i,%i", - (int)gui.x1, (int)gui.y1, - (int)gui.Width(), (int)gui.Height()); -+ CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:SrcRect(%i,%i,%i,%i)", (int)SrcRect.x1, (int)SrcRect.y1, (int)SrcRect.Width(), (int)SrcRect.Height()); -+ CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:DestRect(%i,%i,%i,%i)", (int)DestRect.x1, (int)DestRect.y1, (int)DestRect.Width(), (int)DestRect.Height()); - CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:display(%s)", s_display.c_str()); - CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:gui(%s)", s_gui.c_str()); - CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:m_dst_rect(%s)", s_m_dst_rect.c_str()); -diff --git a/xbmc/utils/AMLUtils.cpp b/xbmc/utils/AMLUtils.cpp -index 80fb453..0f0fef0 100644 ---- a/xbmc/utils/AMLUtils.cpp -+++ b/xbmc/utils/AMLUtils.cpp -@@ -78,7 +78,7 @@ bool aml_wired_present() - } - - bool aml_permissions() --{ -+{ - if (!aml_present()) - return false; - -@@ -209,7 +209,8 @@ bool aml_support_h264_4k2k() - - void aml_set_audio_passthrough(bool passthrough) - { -- SysfsUtils::SetInt("/sys/class/audiodsp/digital_raw", passthrough ? 2:0); -+ CLog::Log(LOGDEBUG, "AML: Setting passthrough %d", passthrough); -+ SysfsUtils::SetString("/sys/class/audiodsp/digital_raw", passthrough ? "2":"0"); - } - - void aml_probe_hdmi_audio() -@@ -227,7 +228,7 @@ void aml_probe_hdmi_audio() - { - char valstr[1024] = {0}; - -- read(fd, valstr, sizeof(valstr) - 1); -+ int tmp = read(fd, valstr, sizeof(valstr) - 1); - valstr[strlen(valstr)] = '\0'; - close(fd); - -@@ -362,6 +363,60 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res) - res->fRefreshRate = 50; - res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE; - } -+ else if (StringUtils::EqualsNoCase(fromMode, "720p23hz")) // fake -+ { -+ res->iWidth = 1280; -+ res->iHeight= 720; -+ res->iScreenWidth = 1280; -+ res->iScreenHeight= 720; -+ res->fRefreshRate = 23.98; -+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE; -+ } -+ else if (StringUtils::EqualsNoCase(fromMode, "720p24hz")) // fake -+ { -+ res->iWidth = 1280; -+ res->iHeight= 720; -+ res->iScreenWidth = 1280; -+ res->iScreenHeight= 720; -+ res->fRefreshRate = 24; -+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE; -+ } -+ else if (StringUtils::EqualsNoCase(fromMode, "720p25hz")) // fake -+ { -+ res->iWidth = 1280; -+ res->iHeight= 720; -+ res->iScreenWidth = 1280; -+ res->iScreenHeight= 720; -+ res->fRefreshRate = 25; -+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE; -+ } -+ else if (StringUtils::EqualsNoCase(fromMode, "720p29hz")) // fake -+ { -+ res->iWidth = 1280; -+ res->iHeight= 720; -+ res->iScreenWidth = 1280; -+ res->iScreenHeight= 720; -+ res->fRefreshRate = 29.97; -+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE; -+ } -+ else if (StringUtils::EqualsNoCase(fromMode, "720p30hz")) // fake -+ { -+ res->iWidth = 1280; -+ res->iHeight= 720; -+ res->iScreenWidth = 1280; -+ res->iScreenHeight= 720; -+ res->fRefreshRate = 30; -+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE; -+ } -+ else if (StringUtils::EqualsNoCase(fromMode, "720p59hz")) // real -+ { -+ res->iWidth = 1280; -+ res->iHeight= 720; -+ res->iScreenWidth = 1280; -+ res->iScreenHeight= 720; -+ res->fRefreshRate = 59.94; -+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE; -+ } - else if (StringUtils::EqualsNoCase(fromMode, "720p") || StringUtils::EqualsNoCase(fromMode, "720p60hz")) - { - res->iWidth = 1280; -@@ -407,6 +462,24 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res) - res->fRefreshRate = 24; - res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE; - } -+ else if (StringUtils::EqualsNoCase(fromMode, "1080p25hz")) -+ { -+ res->iWidth = 1920; -+ res->iHeight= 1080; -+ res->iScreenWidth = 1920; -+ res->iScreenHeight= 1080; -+ res->fRefreshRate = 25; -+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE; -+ } -+ else if (StringUtils::EqualsNoCase(fromMode, "1080p29hz")) // fake -+ { -+ res->iWidth = 1920; -+ res->iHeight= 1080; -+ res->iScreenWidth = 1920; -+ res->iScreenHeight= 1080; -+ res->fRefreshRate = 29.97; -+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE; -+ } - else if (StringUtils::EqualsNoCase(fromMode, "1080p30hz")) - { - res->iWidth = 1920; -@@ -515,7 +588,7 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res) - res->fRefreshRate = 30; - res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE; - } -- else if (StringUtils::EqualsNoCase(fromMode, "2160p50hz420")) -+ else if (StringUtils::EqualsNoCase(fromMode, "2160p50hz")) - { - res->iWidth = 1920; - res->iHeight= 1080; -@@ -524,7 +597,16 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res) - res->fRefreshRate = 50; - res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE; - } -- else if (StringUtils::EqualsNoCase(fromMode, "2160p60hz420")) -+ else if (StringUtils::EqualsNoCase(fromMode, "4k2k59hz") || StringUtils::EqualsNoCase(fromMode, "2160p59hz")) -+ { -+ res->iWidth = 1920; -+ res->iHeight= 1080; -+ res->iScreenWidth = 3840; -+ res->iScreenHeight= 2160; -+ res->fRefreshRate = 59.940; -+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE; -+ } -+ else if (StringUtils::EqualsNoCase(fromMode, "2160p60hz")) - { - res->iWidth = 1920; - res->iHeight= 1080; -@@ -549,4 +631,3 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res) - - return res->iWidth > 0 && res->iHeight> 0; - } -- -diff --git a/xbmc/utils/CPUInfo.cpp b/xbmc/utils/CPUInfo.cpp -index 6377d35..b50b288 100644 ---- a/xbmc/utils/CPUInfo.cpp -+++ b/xbmc/utils/CPUInfo.cpp -@@ -120,7 +120,7 @@ CCPUInfo::CCPUInfo(void) - - size_t len = 4; - std::string cpuVendor; -- -+ - // The number of cores. - if (sysctlbyname("hw.activecpu", &m_cpuCount, &len, NULL, 0) == -1) - m_cpuCount = 1; -@@ -141,7 +141,7 @@ CCPUInfo::CCPUInfo(void) - len = 512; - if (sysctlbyname("machdep.cpu.vendor", &buffer, &len, NULL, 0) == 0) - cpuVendor = buffer; -- -+ - #endif - // Go through each core. - for (int i=0; isecond.m_fSpeed); - else -@@ -597,7 +597,7 @@ bool CCPUInfo::getTemperature(CTemperature& temperature) - { - int value = 0; - char scale = 0; -- -+ - #ifdef TARGET_POSIX - #if defined(TARGET_DARWIN_OSX) - value = SMCGetTemperature(SMC_KEY_CPU_TEMP); -@@ -626,23 +626,24 @@ bool CCPUInfo::getTemperature(CTemperature& temperature) - // procfs is deprecated in the linux kernel, we should move away from - // using it for temperature data. It doesn't seem that sysfs has a - // general enough interface to bother implementing ATM. -- -+ - rewind(m_fProcTemperature); - fflush(m_fProcTemperature); - ret = fscanf(m_fProcTemperature, "temperature: %d %c", &value, &scale); -- -+ - // read from the temperature file of the new kernels - if (!ret) - { - ret = fscanf(m_fProcTemperature, "%d", &value); -- value = value / 1000; -+ if ((int)value > 1000) -+ value = value / 1000; - scale = 'c'; - ret++; - } - } - - if (ret != 2) -- return false; -+ return false; - #endif - #endif // TARGET_POSIX - -@@ -652,7 +653,7 @@ bool CCPUInfo::getTemperature(CTemperature& temperature) - temperature = CTemperature::CreateFromFahrenheit(value); - else - return false; -- -+ - return true; - } - -@@ -707,7 +708,7 @@ bool CCPUInfo::readProcStat(unsigned long long& user, unsigned long long& nice, - const LONGLONG deltaTotal = coreTotal - curCore.m_total, - deltaIdle = coreIdle - curCore.m_idle; - const double load = (double(deltaTotal - deltaIdle) * 100.0) / double(deltaTotal); -- -+ - // win32 has some problems with calculation of load if load close to zero - curCore.m_fPct = (load < 0) ? 0 : load; - if (load >= 0 || deltaTotal > 5 * 10 * 1000 * 1000) // do not update (smooth) values for 5 seconds on negative loads -diff --git a/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp b/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp -index 88cd385..cc62734 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp -+++ b/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp -@@ -23,13 +23,18 @@ - #include "utils/AMLUtils.h" - #include "utils/StringUtils.h" - #include "utils/SysfsUtils.h" -+#include "utils/log.h" - --#include - #include - #include - #include - #include - -+#ifdef CLASSNAME -+#undef CLASSNAME -+#endif -+#define CLASSNAME "CEGLNativeTypeAmlogic" -+ - CEGLNativeTypeAmlogic::CEGLNativeTypeAmlogic() - { - const char *env_framebuffer = getenv("FRAMEBUFFER"); -@@ -53,9 +58,12 @@ bool CEGLNativeTypeAmlogic::CheckCompatibility() - { - std::string name; - std::string modalias = "/sys/class/graphics/" + m_framebuffer_name + "/device/modalias"; -+ std::string meson = "meson"; -+ std::string fb = "fb"; - - SysfsUtils::GetString(modalias, name); -- if (name.find("meson") != std::string::npos) -+ StringUtils::Trim(name); -+ if (name.find(meson) != std::string::npos && name.find(fb) != std::string::npos) - return true; - return false; - } -@@ -63,28 +71,37 @@ bool CEGLNativeTypeAmlogic::CheckCompatibility() - void CEGLNativeTypeAmlogic::Initialize() - { - aml_permissions(); -- DisableFreeScale(); -+ FreeScale(false); - } -+ - void CEGLNativeTypeAmlogic::Destroy() - { -+ SetScreenScale(1, 1, false); - return; - } - - bool CEGLNativeTypeAmlogic::CreateNativeDisplay() - { -+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); -+ - m_nativeDisplay = EGL_DEFAULT_DISPLAY; - return true; - } - - bool CEGLNativeTypeAmlogic::CreateNativeWindow() - { -+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); -+ - #if defined(_FBDEV_WINDOW_H_) - fbdev_window *nativeWindow = new fbdev_window; - if (!nativeWindow) - return false; - -- nativeWindow->width = 1920; -- nativeWindow->height = 1080; -+ RESOLUTION_INFO res; -+ GetPreferredResolution(&res); -+ -+ nativeWindow->width = res.iWidth; -+ nativeWindow->height = res.iHeight; - m_nativeWindow = nativeWindow; - - SetFramebufferResolution(nativeWindow->width, nativeWindow->height); -@@ -97,6 +114,8 @@ bool CEGLNativeTypeAmlogic::CreateNativeWindow() - - bool CEGLNativeTypeAmlogic::GetNativeDisplay(XBNativeDisplayType **nativeDisplay) const - { -+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); -+ - if (!nativeDisplay) - return false; - *nativeDisplay = (XBNativeDisplayType*) &m_nativeDisplay; -@@ -105,6 +124,8 @@ bool CEGLNativeTypeAmlogic::GetNativeDisplay(XBNativeDisplayType **nativeDisplay - - bool CEGLNativeTypeAmlogic::GetNativeWindow(XBNativeWindowType **nativeWindow) const - { -+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); -+ - if (!nativeWindow) - return false; - *nativeWindow = (XBNativeWindowType*) &m_nativeWindow; -@@ -113,11 +134,15 @@ bool CEGLNativeTypeAmlogic::GetNativeWindow(XBNativeWindowType **nativeWindow) c - - bool CEGLNativeTypeAmlogic::DestroyNativeDisplay() - { -+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); -+ - return true; - } - - bool CEGLNativeTypeAmlogic::DestroyNativeWindow() - { -+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); -+ - #if defined(_FBDEV_WINDOW_H_) - delete (fbdev_window*)m_nativeWindow, m_nativeWindow = NULL; - #endif -@@ -133,6 +158,8 @@ bool CEGLNativeTypeAmlogic::GetNativeResolution(RESOLUTION_INFO *res) const - - bool CEGLNativeTypeAmlogic::SetNativeResolution(const RESOLUTION_INFO &res) - { -+ CLog::Log(LOGNOTICE, "%s::%s to %dx%d@%f", CLASSNAME, __func__, res.iScreenWidth, res.iScreenHeight, res.fRefreshRate); -+ - #if defined(_FBDEV_WINDOW_H_) - if (m_nativeWindow) - { -@@ -152,6 +179,8 @@ bool CEGLNativeTypeAmlogic::SetNativeResolution(const RESOLUTION_INFO &res) - - bool CEGLNativeTypeAmlogic::ProbeResolutions(std::vector &resolutions) - { -+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); -+ - std::string valstr; - SysfsUtils::GetString("/sys/class/amhdmitx/amhdmitx0/disp_cap", valstr); - std::vector probe_str = StringUtils::Split(valstr, "\n"); -@@ -164,11 +193,12 @@ bool CEGLNativeTypeAmlogic::ProbeResolutions(std::vector &resol - resolutions.push_back(res); - } - return resolutions.size() > 0; -- - } - - bool CEGLNativeTypeAmlogic::GetPreferredResolution(RESOLUTION_INFO *res) const - { -+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); -+ - // check display/mode, it gets defaulted at boot - if (!GetNativeResolution(res)) - { -@@ -181,6 +211,8 @@ bool CEGLNativeTypeAmlogic::GetPreferredResolution(RESOLUTION_INFO *res) const - - bool CEGLNativeTypeAmlogic::ShowWindow(bool show) - { -+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); -+ - std::string blank_framebuffer = "/sys/class/graphics/" + m_framebuffer_name + "/blank"; - SysfsUtils::SetInt(blank_framebuffer.c_str(), show ? 0 : 1); - return true; -@@ -188,6 +220,8 @@ bool CEGLNativeTypeAmlogic::ShowWindow(bool show) - - bool CEGLNativeTypeAmlogic::SetDisplayResolution(const char *resolution) - { -+ CLog::Log(LOGNOTICE, "%s::%s to %s", CLASSNAME, __func__, resolution); -+ - std::string mode = resolution; - // switch display resolution - SysfsUtils::SetString("/sys/class/display/mode", mode.c_str()); -@@ -195,36 +229,46 @@ bool CEGLNativeTypeAmlogic::SetDisplayResolution(const char *resolution) - RESOLUTION_INFO res; - aml_mode_to_resolution(mode.c_str(), &res); - SetFramebufferResolution(res); -+ DealWithScale(res); - - return true; - } - --void CEGLNativeTypeAmlogic::SetupVideoScaling(const char *mode) -+void CEGLNativeTypeAmlogic::FreeScale(bool state) - { -- SysfsUtils::SetInt("/sys/class/graphics/fb0/blank", 1); -- SysfsUtils::SetInt("/sys/class/graphics/fb0/free_scale", 0); -- SysfsUtils::SetInt("/sys/class/graphics/fb1/free_scale", 0); -- SysfsUtils::SetInt("/sys/class/ppmgr/ppscaler", 0); -+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); - -- if (strstr(mode, "1080")) -- { -- SysfsUtils::SetString("/sys/class/graphics/fb0/request2XScale", "8"); -- SysfsUtils::SetString("/sys/class/graphics/fb1/scale_axis", "1280 720 1920 1080"); -- SysfsUtils::SetString("/sys/class/graphics/fb1/scale", "0x10001"); -- } -- else -- { -- SysfsUtils::SetString("/sys/class/graphics/fb0/request2XScale", "16 1280 720"); -+ std::string freescale_framebuffer = "/sys/class/graphics/" + m_framebuffer_name + "/free_scale"; -+ SysfsUtils::SetInt(freescale_framebuffer.c_str(), state ? 1 : 0); -+} -+ -+void CEGLNativeTypeAmlogic::DealWithScale(const RESOLUTION_INFO &res) -+{ -+ CLog::Log(LOGDEBUG, "%s::%s Interface is %dx%d, screen size is %dx%d", CLASSNAME, __func__, res.iWidth, res.iHeight, res.iScreenWidth, res.iScreenHeight); -+ -+ if (res.iScreenWidth > res.iWidth && res.iScreenHeight > res.iHeight) { -+ CLog::Log(LOGNOTICE, "%s::%s Scaling interfaces of size %dx%d to full screen", CLASSNAME, __func__, res.iWidth, res.iHeight); -+ SetScreenScale(res.iWidth, res.iHeight, true); - } -+} - -- SysfsUtils::SetInt("/sys/class/graphics/fb0/blank", 0); -+void CEGLNativeTypeAmlogic::SetScreenScale(int width, int height, bool state) -+{ -+ char setting[256] = {}; -+ sprintf(setting, "0 0 %d %d", width - 1 , height - 1); -+ std::string framebuffer = "/sys/class/graphics/" + m_framebuffer_name; -+ SysfsUtils::SetString(framebuffer + "/scale_axis", setting); -+ SysfsUtils::SetString(framebuffer + "/scale", state ? "0x10001" : "0x0"); - } - --void CEGLNativeTypeAmlogic::DisableFreeScale() -+bool CEGLNativeTypeAmlogic::IsHdmiConnected() const - { -- // turn off frame buffer freescale -- SysfsUtils::SetInt("/sys/class/graphics/fb0/free_scale", 0); -- SysfsUtils::SetInt("/sys/class/graphics/fb1/free_scale", 0); -+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); -+ -+ std::string hpd_state; -+ SysfsUtils::GetString("/sys/class/amhdmitx/amhdmitx0/disp_cap", hpd_state); -+ StringUtils::Trim(hpd_state); -+ return hpd_state == "1"; - } - - void CEGLNativeTypeAmlogic::SetFramebufferResolution(const RESOLUTION_INFO &res) const -@@ -244,8 +288,8 @@ void CEGLNativeTypeAmlogic::SetFramebufferResolution(int width, int height) cons - { - vinfo.xres = width; - vinfo.yres = height; -- vinfo.xres_virtual = 1920; -- vinfo.yres_virtual = 2160; -+ vinfo.xres_virtual = width; -+ vinfo.yres_virtual = height * 2; - vinfo.bits_per_pixel = 32; - vinfo.activate = FB_ACTIVATE_ALL; - ioctl(fd0, FBIOPUT_VSCREENINFO, &vinfo); -diff --git a/xbmc/windowing/egl/EGLNativeTypeAmlogic.h b/xbmc/windowing/egl/EGLNativeTypeAmlogic.h -index cfb33ca..bdb08b6 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeAmlogic.h -+++ b/xbmc/windowing/egl/EGLNativeTypeAmlogic.h -@@ -24,6 +24,19 @@ - #include - - #include "EGLNativeType.h" -+#include -+ -+#ifndef _FBDEV_WINDOW_H_ -+// Define it right here, since some platforms doesn't has fbdev_window.h at all. -+// This will not make it fail on these platforms badly, since it will fail softly anyway on some other init steps. -+#define _FBDEV_WINDOW_H_ -+typedef struct fbdev_window -+{ -+ unsigned short width; -+ unsigned short height; -+} fbdev_window; -+#endif -+ - class CEGLNativeTypeAmlogic : public CEGLNativeType - { - public: -@@ -52,12 +65,14 @@ public: - - protected: - bool SetDisplayResolution(const char *resolution); -- void SetupVideoScaling(const char *mode); -- void DisableFreeScale(); - - private: - void SetFramebufferResolution(const RESOLUTION_INFO &res) const; - void SetFramebufferResolution(int width, int height) const; -+ void FreeScale(bool state); -+ void DealWithScale(const RESOLUTION_INFO &res); -+ void SetScreenScale(int width, int height, bool state); -+ bool IsHdmiConnected() const; - - std::string m_framebuffer_name; - }; --- -1.9.1 - diff --git a/projects/Odroid_C2/patches/kodi/kodi-0004-Multichannel-PCM-and-HD-Audio-passthrough.patch b/projects/Odroid_C2/patches/kodi/kodi-0004-Multichannel-PCM-and-HD-Audio-passthrough.patch deleted file mode 100644 index 9169cacad5..0000000000 --- a/projects/Odroid_C2/patches/kodi/kodi-0004-Multichannel-PCM-and-HD-Audio-passthrough.patch +++ /dev/null @@ -1,102 +0,0 @@ -From a49dd2258d46279466d5aaba44d1f0ee06253ff2 Mon Sep 17 00:00:00 2001 -From: kszaq -Date: Sun, 4 Sep 2016 00:51:03 +0200 -Subject: [PATCH] [aml] Multichannel-PCM and HD Audio passthrough - -1. If we want passthrough, is should be redirected to device 1. To make sure device 1 output is enabled, set device 0 to stereo. -2. Set digital_codec parameter to notify sound driver about audio format. -3. Amlogic wants 48kHz for EAC3 passthrough. -4. Identify Amlogic audio output as HDMI. ---- - xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 59 +++++++++++++++++++++++++++-- - 1 file changed, 55 insertions(+), 4 deletions(-) - -diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp -index 6a9066b..9741e3e 100644 ---- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp -+++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp -@@ -38,6 +38,7 @@ - #include "settings/AdvancedSettings.h" - #if defined(HAS_LIBAMCODEC) - #include "utils/AMLUtils.h" -+#include "utils/SysfsUtils.h" - #endif - - #ifdef TARGET_POSIX -@@ -534,13 +535,57 @@ bool CAESinkALSA::Initialize(AEAudioFormat &format, std::string &device) - { - m_passthrough = false; - } --#if defined(HAS_LIBAMCODEC) -- if (aml_present()) -+ -+ if (device.find("M8AUDIO") != std::string::npos) - { -+ int aml_digital_codec = 0; -+ -+ if (m_passthrough) -+ { -+ /* Open 2 channels at device 0 to enable device 1 output to HDMI */ -+ ALSAConfig m_inconfig, m_outconfig; -+ snd_config_t *config; -+ m_inconfig = inconfig; -+ m_inconfig.channels = 2; -+ snd_config_copy(&config, snd_config); -+ OpenPCMDevice("hw:AMLM8AUDIO,0", "", m_inconfig.channels, &m_pcm, config); -+ snd_config_delete(config); -+ InitializeHW(m_inconfig, m_outconfig); -+ -+ /* Passthrough is supported only by device 1 */ -+ device = "hw:AMLM8AUDIO,1"; -+ -+ switch(format.m_streamInfo.m_type) -+ { -+ case CAEStreamInfo::STREAM_TYPE_AC3: -+ aml_digital_codec = 2; -+ break; -+ -+ case CAEStreamInfo::STREAM_TYPE_DTS_512: -+ case CAEStreamInfo::STREAM_TYPE_DTS_1024: -+ case CAEStreamInfo::STREAM_TYPE_DTS_2048: -+ case CAEStreamInfo::STREAM_TYPE_DTSHD_CORE: -+ aml_digital_codec = 3; -+ break; -+ -+ case CAEStreamInfo::STREAM_TYPE_EAC3: -+ aml_digital_codec = 4; -+ inconfig.sampleRate = 48000; -+ break; -+ -+ case CAEStreamInfo::STREAM_TYPE_DTSHD: -+ aml_digital_codec = 8; -+ break; -+ -+ case CAEStreamInfo::STREAM_TYPE_TRUEHD: -+ aml_digital_codec = 7; -+ break; -+ } -+ } -+ - aml_set_audio_passthrough(m_passthrough); -- device = "default"; -+ SysfsUtils::SetInt("/sys/class/audiodsp/digital_codec", aml_digital_codec); - } --#endif - - if (inconfig.channels == 0) - { -@@ -1550,6 +1595,12 @@ void CAESinkALSA::EnumerateDevice(AEDeviceInfoList &list, const std::string &dev - info.m_dataFormats.push_back(i); - } - -+ if (info.m_displayName.find("M8AUDIO") != std::string::npos) -+ { -+ info.m_displayNameExtra = "HDMI"; -+ info.m_deviceType = AE_DEVTYPE_HDMI; -+ } -+ - if (info.m_deviceType == AE_DEVTYPE_HDMI) - { - // we don't trust ELD information and push back our supported formats explicitely --- -1.8.3.1 diff --git a/projects/WeTek_Hub/patches/kodi/0004-powermanagement-disable-suspend.patch b/projects/WeTek_Hub/patches/kodi/0004-powermanagement-disable-suspend.patch deleted file mode 100644 index 42009e9ce6..0000000000 --- a/projects/WeTek_Hub/patches/kodi/0004-powermanagement-disable-suspend.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/xbmc/powermanagement/linux/LogindUPowerSyscall.cpp b/xbmc/powermanagement/linux/LogindUPowerSyscall.cpp -index 4e5bcc6..ad5847d 100644 ---- a/xbmc/powermanagement/linux/LogindUPowerSyscall.cpp -+++ b/xbmc/powermanagement/linux/LogindUPowerSyscall.cpp -@@ -53,7 +53,7 @@ CLogindUPowerSyscall::CLogindUPowerSyscall() - m_canPowerdown = LogindCheckCapability("CanPowerOff"); - m_canReboot = LogindCheckCapability("CanReboot"); - m_canHibernate = LogindCheckCapability("CanHibernate"); -- m_canSuspend = LogindCheckCapability("CanSuspend"); -+ m_canSuspend = false; - - InhibitDelayLock(); - diff --git a/projects/WeTek_Hub/patches/libcec/libcec-00-aocec-support.patch b/projects/WeTek_Hub/patches/libcec/libcec-00-aocec-support.patch deleted file mode 100644 index b3cd656c99..0000000000 --- a/projects/WeTek_Hub/patches/libcec/libcec-00-aocec-support.patch +++ /dev/null @@ -1,803 +0,0 @@ -diff --git a/README.md b/README.md -index dfaf4d6..87491ef 100644 ---- a/README.md -+++ b/README.md -@@ -93,6 +93,12 @@ To compile in support for Exynos devices, you have to pass the argument -DHAVE_E - 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 - To compile in support for TDA995x devices, you have to pass the argument -DHAVE_TDA995X_API=1 to cmake: - ``` -diff --git a/include/cectypes.h b/include/cectypes.h -index 0fdd48e..881a805 100644 ---- a/include/cectypes.h -+++ b/include/cectypes.h -@@ -309,6 +309,16 @@ namespace CEC { - #define CEC_EXYNOS_VIRTUAL_COM "Exynos" - - /*! -+ * 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 - */ - #define CEC_MIN_LIB_VERSION 3 -@@ -877,7 +887,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 */ -diff --git a/src/libcec/CMakeLists.txt b/src/libcec/CMakeLists.txt -index a494533..d3eefa3 100644 ---- a/src/libcec/CMakeLists.txt -+++ b/src/libcec/CMakeLists.txt -@@ -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 -diff --git a/src/libcec/adapter/AOCEC/AOCEC.h b/src/libcec/adapter/AOCEC/AOCEC.h -new file mode 100644 -index 0000000..560fbdd ---- /dev/null -+++ b/src/libcec/adapter/AOCEC/AOCEC.h -@@ -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 -+ * 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 -diff --git a/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.cpp b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.cpp -new file mode 100644 -index 0000000..8edf981 ---- /dev/null -+++ b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.cpp -@@ -0,0 +1,343 @@ -+/* -+ * 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 -+ * http://www.pulse-eight.com/ -+ * http://www.pulse-eight.net/ -+ */ -+ -+#include "env.h" -+#include -+#include -+ -+ -+#if defined(HAVE_AOCEC_API) -+#include "AOCEC.h" -+#include "AOCECAdapterCommunication.h" -+ -+#include "CECTypeUtils.h" -+#include "LibCEC.h" -+#include -+ -+using namespace CEC; -+using namespace P8PLATFORM; -+ -+#define LIB_CEC m_callback->GetLib() -+ -+ -+CAOCECAdapterCommunication::CAOCECAdapterCommunication(IAdapterCommunicationCallback *callback) : -+ IAdapterCommunication(callback), -+ m_bLogicalAddressChanged(false) -+{ -+ CLockObject lock(m_mutex); -+ -+ m_logicalAddresses.Clear(); -+ m_fd = INVALID_SOCKET_VALUE; -+} -+ -+ -+CAOCECAdapterCommunication::~CAOCECAdapterCommunication(void) -+{ -+ Close(); -+} -+ -+ -+bool CAOCECAdapterCommunication::IsOpen(void) -+{ -+ CLockObject lock(m_mutex); -+ return IsInitialised() && m_fd != INVALID_SOCKET_VALUE; -+} -+ -+ -+bool CAOCECAdapterCommunication::Open(uint32_t UNUSED(iTimeoutMs), bool UNUSED(bSkipChecks), bool bStartListening) -+{ -+ if (IsOpen()) -+ Close(); -+ -+ CLockObject lock(m_mutex); -+ -+ if ((m_fd = open(CEC_AOCEC_PATH, O_RDWR)) > 0) -+ { -+ uint32_t enable = true; -+ -+ if (ioctl(m_fd, CEC_IOC_SET_OPTION_SYS_CTRL, enable)) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL IOCTL CEC_IOC_SET_OPTION_SYS_CTRL failed !", __func__); -+ return false; -+ } -+ -+ if (!bStartListening || CreateThread()) { -+ return true; -+ } -+ close(m_fd); -+ m_fd = INVALID_SOCKET_VALUE; -+ } -+ return false; -+} -+ -+ -+void CAOCECAdapterCommunication::Close(void) -+{ -+ StopThread(0); -+ -+ CLockObject lock(m_mutex); -+ -+ uint32_t enable = false; -+ -+ if (ioctl(m_fd, CEC_IOC_SET_OPTION_SYS_CTRL, enable)) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_SET_OPTION_SYS_CTRL failed !", __func__); -+ } -+ -+ close(m_fd); -+ m_fd = INVALID_SOCKET_VALUE; -+} -+ -+ -+std::string CAOCECAdapterCommunication::GetError(void) const -+{ -+ std::string strError(m_strError); -+ return strError; -+} -+ -+int CAOCECAdapterCommunication::getFileDescriptor(void) -+{ -+ CLockObject lock(m_mutex); -+ -+ return m_fd; -+} -+ -+ -+ -+cec_adapter_message_state CAOCECAdapterCommunication::Write( -+ const cec_command &data, bool &UNUSED(bRetry), uint8_t UNUSED(iLineTimeout), bool UNUSED(bIsReply)) -+{ -+ uint8_t buffer[CEC_MAX_FRAME_SIZE]; -+ int32_t size = 1; -+ cec_adapter_message_state rc = ADAPTER_MESSAGE_STATE_ERROR; -+ -+ if (!IsOpen()) -+ return rc; -+ -+ CLockObject lock(m_mutex); -+ -+ if ((size_t)data.parameters.size + data.opcode_set > sizeof(buffer)) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: data size too large !", __func__); -+ return ADAPTER_MESSAGE_STATE_ERROR; -+ } -+ -+ buffer[0] = (data.initiator << 4) | (data.destination & 0x0f); -+ -+ if (data.opcode_set) -+ { -+ buffer[1] = data.opcode; -+ size++; -+ -+ memcpy(&buffer[size], data.parameters.data, data.parameters.size); -+ size += data.parameters.size; -+ } -+ -+ if (write(m_fd, (void *)buffer, size) == size) -+ { -+ rc = ADAPTER_MESSAGE_STATE_SENT_ACKED; -+ } -+ else -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: write failed !", __func__); -+ } -+ -+ return rc; -+} -+ -+ -+uint16_t CAOCECAdapterCommunication::GetFirmwareVersion(void) -+{ -+ int version = 0; -+ -+ if (!IsOpen()) -+ return version; -+ -+ CLockObject lock(m_mutex); -+ -+ if (ioctl(m_fd, CEC_IOC_GET_VERSION, &version) < 0) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_GET_VERSION failed !", __func__); -+ } -+ return (uint16_t)version; -+} -+ -+ -+cec_vendor_id CAOCECAdapterCommunication::GetVendorId(void) -+{ -+ int vendor_id = CEC_VENDOR_UNKNOWN; -+ -+ if (!IsOpen()) -+ return cec_vendor_id(vendor_id); -+ -+ CLockObject lock(m_mutex); -+ -+ if (ioctl(m_fd, CEC_IOC_GET_VENDOR_ID, &vendor_id) < 0) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_GET_VENDOR_ID failed !", __func__); -+ } -+ return cec_vendor_id(vendor_id); -+} -+ -+ -+uint16_t CAOCECAdapterCommunication::GetPhysicalAddress(void) -+{ -+ int phys_addr = CEC_DEFAULT_PADDR; -+ -+ if (!IsOpen()) -+ return (uint16_t)phys_addr; -+ -+ CLockObject lock(m_mutex); -+ -+ if (ioctl(m_fd, CEC_IOC_GET_PHYSICAL_ADDR, &phys_addr) < 0) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_GET_PHYSICAL_ADDR failed !", __func__); -+ phys_addr = CEC_DEFAULT_PADDR; -+ } -+ return (uint16_t)phys_addr; -+} -+ -+ -+cec_logical_addresses CAOCECAdapterCommunication::GetLogicalAddresses(void) -+{ -+ return m_logicalAddresses; -+} -+ -+ -+bool CAOCECAdapterCommunication::SetLogicalAddresses(const cec_logical_addresses &addresses) -+{ -+ unsigned int log_addr = addresses.primary; -+ if (!IsOpen()) -+ return false; -+ -+ CLockObject lock(m_mutex); -+ -+ if (ioctl(m_fd, CEC_IOC_ADD_LOGICAL_ADDR, log_addr)) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_ADD_LOGICAL_ADDR failed !", __func__); -+ return false; -+ } -+ m_logicalAddresses = addresses; -+ m_bLogicalAddressChanged = true; -+ -+ return true; -+} -+ -+ -+void CAOCECAdapterCommunication::HandleLogicalAddressLost(cec_logical_address UNUSED(oldAddress)) -+{ -+ unsigned int log_addr = CECDEVICE_BROADCAST; -+ -+ if (!IsOpen()) -+ return; -+ -+ CLockObject lock(m_mutex); -+ -+ if (ioctl(m_fd, CEC_IOC_ADD_LOGICAL_ADDR, log_addr)) -+ { -+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_ADD_LOGICAL_ADDR failed !", __func__); -+ } -+} -+ -+ -+void *CAOCECAdapterCommunication::Process(void) -+{ -+ uint8_t buffer[CEC_MAX_FRAME_SIZE]; -+ uint32_t size; -+ fd_set rfds; -+ cec_logical_address initiator, destination; -+ struct timeval tv; -+ -+ if (!IsOpen()) -+ return 0; -+ -+ while (!IsStopped()) -+ { -+ int fd = getFileDescriptor(); -+ -+ if (fd == INVALID_SOCKET_VALUE) -+ { -+ break; -+ } -+ -+ FD_ZERO(&rfds); -+ FD_SET(fd, &rfds); -+ -+ tv.tv_sec = 1; -+ tv.tv_usec = 0; -+ -+ if (select(fd + 1, &rfds, NULL, NULL, &tv) >= 0 ) -+ { -+ -+ if (!FD_ISSET(fd, &rfds)) -+ continue; -+ -+ size = read(fd, buffer, CEC_MAX_FRAME_SIZE); -+ -+ if (size > 0) -+ { -+#if 0 // currently unused -+ if (buffer[0] == 0xff) // driver wants us to reread the physical address -+ { -+ if (!IsStopped()) -+ { -+ uint16_t iNewAddress = GetPhysicalAddress(); -+ m_callback->HandlePhysicalAddressChanged(iNewAddress); -+ } -+ continue; -+ } -+#endif -+ initiator = cec_logical_address(buffer[0] >> 4); -+ destination = cec_logical_address(buffer[0] & 0x0f); -+ -+ cec_command cmd; -+ -+ cec_command::Format( -+ cmd, initiator, destination, -+ ( size > 1 ) ? cec_opcode(buffer[1]) : CEC_OPCODE_NONE); -+ -+ for( uint8_t i = 2; i < size; i++ ) -+ cmd.parameters.PushBack(buffer[i]); -+ -+ if (!IsStopped()) -+ m_callback->OnCommandReceived(cmd); -+ } -+ } -+ } -+ -+ return 0; -+} -+ -+#endif // HAVE_AOCEC_API -diff --git a/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.h b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.h -new file mode 100644 -index 0000000..f6a8a4a ---- /dev/null -+++ b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.h -@@ -0,0 +1,105 @@ -+#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 -+ * http://www.pulse-eight.com/ -+ * http://www.pulse-eight.net/ -+ */ -+ -+#include "env.h" -+ -+#if defined(HAVE_AOCEC_API) -+ -+#include -+#include -+#include "../AdapterCommunication.h" -+#include -+ -+namespace CEC -+{ -+ class CAOCECAdapterCommunication : public IAdapterCommunication, public P8PLATFORM::CThread -+ { -+ public: -+ /*! -+ * @brief Create a new Exynos HDMI CEC communication handler. -+ * @param callback The callback to use for incoming CEC commands. -+ */ -+ CAOCECAdapterCommunication(IAdapterCommunicationCallback *callback); -+ virtual ~CAOCECAdapterCommunication(void); -+ -+ /** @name IAdapterCommunication implementation */ -+ ///{ -+ bool Open(uint32_t iTimeoutMs = CEC_DEFAULT_CONNECT_TIMEOUT, bool bSkipChecks = false, bool bStartListening = true); -+ void Close(void); -+ bool IsOpen(void); -+ std::string GetError(void) const; -+ cec_adapter_message_state Write(const cec_command &data, bool &bRetry, uint8_t iLineTimeout, bool bIsReply); -+ -+ bool SetLineTimeout(uint8_t UNUSED(iTimeout)) { return true; } -+ bool StartBootloader(void) { return false; } -+ bool SetLogicalAddresses(const cec_logical_addresses &addresses); -+ cec_logical_addresses GetLogicalAddresses(void); -+ bool PingAdapter(void) { return IsInitialised(); } -+ uint16_t GetFirmwareVersion(void); -+ uint32_t GetFirmwareBuildDate(void) { return 0; } -+ bool IsRunningLatestFirmware(void) { return true; } -+ bool PersistConfiguration(const libcec_configuration & UNUSED(configuration)) { return false; } -+ bool GetConfiguration(libcec_configuration & UNUSED(configuration)) { return false; } -+ std::string GetPortName(void) { return std::string("AOCEC"); } -+ uint16_t GetPhysicalAddress(void); -+ bool SetControlledMode(bool UNUSED(controlled)) { return true; } -+ cec_vendor_id GetVendorId(void); -+ bool SupportsSourceLogicalAddress(const cec_logical_address address) { return address > CECDEVICE_TV && address <= CECDEVICE_BROADCAST; } -+ cec_adapter_type GetAdapterType(void) { return ADAPTERTYPE_AOCEC; } -+ uint16_t GetAdapterVendorId(void) const { return 1; } -+ uint16_t GetAdapterProductId(void) const { return 1; } -+ void HandleLogicalAddressLost(cec_logical_address oldAddress); -+ void SetActiveSource(bool UNUSED(bSetTo), bool UNUSED(bClientUnregistered)) {} -+ ///} -+ -+ /** @name P8PLATFORM::CThread implementation */ -+ ///{ -+ void *Process(void); -+ ///} -+ -+ private: -+ bool IsInitialised(void) const { return 1; }; -+ int getFileDescriptor(void); -+ -+ std::string m_strError; /**< current error message */ -+ -+ bool m_bLogicalAddressChanged; -+ cec_logical_addresses m_logicalAddresses; -+ P8PLATFORM::CMutex m_mutex; -+ int m_fd; -+ }; -+}; -+#endif -diff --git a/src/libcec/adapter/AOCEC/AOCECAdapterDetection.cpp b/src/libcec/adapter/AOCEC/AOCECAdapterDetection.cpp -new file mode 100644 -index 0000000..55f3ee0 ---- /dev/null -+++ b/src/libcec/adapter/AOCEC/AOCECAdapterDetection.cpp -@@ -0,0 +1,50 @@ -+/* -+ * 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 -+ * http://www.pulse-eight.com/ -+ * http://www.pulse-eight.net/ -+ */ -+ -+#include "env.h" -+#include -+ -+#if defined(HAVE_AOCEC_API) -+#include "AOCECAdapterDetection.h" -+#include "AOCEC.h" -+ -+using namespace CEC; -+ -+bool CAOCECAdapterDetection::FindAdapter(void) -+{ -+ return access(CEC_AOCEC_PATH, 0) == 0; -+} -+ -+#endif -diff --git a/src/libcec/adapter/AOCEC/AOCECAdapterDetection.h b/src/libcec/adapter/AOCEC/AOCECAdapterDetection.h -new file mode 100644 -index 0000000..cacaa19 ---- /dev/null -+++ b/src/libcec/adapter/AOCEC/AOCECAdapterDetection.h -@@ -0,0 +1,46 @@ -+#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 -+ * http://www.pulse-eight.com/ -+ * http://www.pulse-eight.net/ -+ */ -+ -+#include "env.h" -+ -+namespace CEC -+{ -+ class CAOCECAdapterDetection -+ { -+ public: -+ static bool FindAdapter(void); -+ }; -+} -diff --git a/src/libcec/adapter/AdapterFactory.cpp b/src/libcec/adapter/AdapterFactory.cpp -index da05725..1e946e6 100644 ---- a/src/libcec/adapter/AdapterFactory.cpp -+++ b/src/libcec/adapter/AdapterFactory.cpp -@@ -58,6 +58,11 @@ - #include "Exynos/ExynosCECAdapterCommunication.h" - #endif - -+#if defined(HAVE_AOCEC_API) -+#include "AOCEC/AOCECAdapterDetection.h" -+#include "AOCEC/AOCECAdapterCommunication.h" -+#endif -+ - using namespace CEC; - - int8_t CAdapterFactory::FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */) -@@ -126,8 +131,20 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8 - } - #endif - -+#if defined(HAVE_AOCEC_API) -+ if (iAdaptersFound < iBufSize && CAOCECAdapterDetection::FindAdapter()) -+ { -+ snprintf(deviceList[iAdaptersFound].strComPath, sizeof(deviceList[iAdaptersFound].strComPath), CEC_AOCEC_PATH); -+ snprintf(deviceList[iAdaptersFound].strComName, sizeof(deviceList[iAdaptersFound].strComName), CEC_AOCEC_VIRTUAL_COM); -+ deviceList[iAdaptersFound].iVendorId = 0; -+ deviceList[iAdaptersFound].iProductId = 0; -+ deviceList[iAdaptersFound].adapterType = ADAPTERTYPE_AOCEC; -+ iAdaptersFound++; -+ } -+#endif -+ - --#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) -+#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_AOCEC_API) - #error "libCEC doesn't have support for any type of adapter. please check your build system or configuration" - #endif - -@@ -146,6 +163,11 @@ IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_ - return new CExynosCECAdapterCommunication(m_lib->m_cec); - #endif - -+#if defined(HAVE_AOCEC_API) -+ if (!strcmp(strPort, CEC_AOCEC_VIRTUAL_COM)) -+ return new CAOCECAdapterCommunication(m_lib->m_cec); -+#endif -+ - #if defined(HAVE_RPI_API) - if (!strcmp(strPort, CEC_RPI_VIRTUAL_COM)) - return new CRPiCECAdapterCommunication(m_lib->m_cec); -diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake -index b8a16c8..93a97e6 100644 ---- a/src/libcec/cmake/CheckPlatformSupport.cmake -+++ b/src/libcec/cmake/CheckPlatformSupport.cmake -@@ -9,6 +9,7 @@ - # HAVE_RPI_API 1 if Raspberry Pi is supported - # HAVE_TDA995X_API 1 if TDA995X is supported - # HAVE_EXYNOS_API 1 if Exynos is supported -+# HAVE_AOCEC_API 1 if AOCEC is supported - # HAVE_P8_USB 1 if Pulse-Eight devices are supported - # HAVE_P8_USB_DETECT 1 if Pulse-Eight devices can be auto-detected - # HAVE_DRM_EDID_PARSER 1 if DRM EDID parsing is supported -@@ -132,6 +133,18 @@ else() - else() - set(HAVE_EXYNOS_API 0) - endif() -+ -+ # AOCEC -+ if (${HAVE_AOCEC_API}) -+ set(LIB_INFO "${LIB_INFO}, AOCEC") -+ set(HAVE_AOCEC_API 1) -+ set(CEC_SOURCES_ADAPTER_AOCEC adapter/AOCEC/AOCECAdapterDetection.cpp -+ adapter/AOCEC/AOCECAdapterCommunication.cpp) -+ source_group("Source Files\\adapter\\AOCEC" FILES ${CEC_SOURCES_ADAPTER_AOCEC}) -+ list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_AOCEC}) -+ else() -+ set(HAVE_AOCEC_API 0) -+ endif() - endif() - - # rt -diff --git a/src/libcec/cmake/DisplayPlatformSupport.cmake b/src/libcec/cmake/DisplayPlatformSupport.cmake -index 9dcaacf..7ec10f5 100644 ---- a/src/libcec/cmake/DisplayPlatformSupport.cmake -+++ b/src/libcec/cmake/DisplayPlatformSupport.cmake -@@ -44,6 +44,12 @@ else() - message(STATUS "DRM support: no") - endif() - -+if (HAVE_AOCEC_API) -+ message(STATUS "AOCEC support: yes") -+else() -+ message(STATUS "AOCEC support: no") -+endif() -+ - if (HAVE_PYTHON) - message(STATUS "Python support: version ${PYTHONLIBS_VERSION_STRING} (${PYTHON_VERSION})") - else() -diff --git a/src/libcec/env.h.in b/src/libcec/env.h.in -index 0496aa0..fe6c83d 100644 ---- a/src/libcec/env.h.in -+++ b/src/libcec/env.h.in -@@ -72,6 +72,9 @@ - /* Define to 1 for Exynos support */ - #cmakedefine HAVE_EXYNOS_API @HAVE_EXYNOS_API@ - -+/* Define to 1 for AOCEC support */ -+#cmakedefine HAVE_AOCEC_API @HAVE_AOCEC_API@ -+ - /* Define to 1 for nVidia EDID parsing support (on selected models) */ - #cmakedefine HAVE_NVIDIA_EDID_PARSER @HAVE_NVIDIA_EDID_PARSER@ - diff --git a/projects/WeTek_Hub/patches/linux/limit_avaiable_sampling_freqencies_and_bit_depths.patch b/projects/WeTek_Hub/patches/linux/limit_avaiable_sampling_freqencies_and_bit_depths.patch deleted file mode 100644 index d268e5b3ad..0000000000 --- a/projects/WeTek_Hub/patches/linux/limit_avaiable_sampling_freqencies_and_bit_depths.patch +++ /dev/null @@ -1,58 +0,0 @@ -From edab2a489829689fdaadb90f1897c948ea3c9020 Mon Sep 17 00:00:00 2001 -From: kszaq -Date: Wed, 3 Jun 2015 10:20:04 +0200 -Subject: [PATCH] sound/soc/aml/m8: Report only working frequecies and bit - depths - ---- - sound/soc/aml/m8/aml_spdif_codec.c | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/sound/soc/aml/m8/aml_spdif_codec.c b/sound/soc/aml/m8/aml_spdif_codec.c -index ac76ef6..cf0e929 100644 ---- a/sound/soc/aml/m8/aml_spdif_codec.c -+++ b/sound/soc/aml/m8/aml_spdif_codec.c -@@ -26,9 +26,8 @@ - - #define DRV_NAME "spdif-dit" - --#define STUB_RATES SNDRV_PCM_RATE_8000_192000 --#define STUB_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ -- SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) -+#define STUB_RATES SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000 -+#define STUB_FORMATS SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE - - struct pinctrl *pin_spdif_ctl; - struct device *spdif_dev; --- -1.8.3.1 - -From 1e6294498438359c4ac39b2ab563487d750fbaaf Mon Sep 17 00:00:00 2001 -From: kszaq -Date: Tue, 30 Aug 2016 23:31:29 +0200 -Subject: [PATCH] sound/soc/aml/m8: report only working frequencies and bit - depths for I2S - ---- - sound/soc/aml/m8/aml_i2s_dai.c | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/sound/soc/aml/m8/aml_i2s_dai.c b/sound/soc/aml/m8/aml_i2s_dai.c -index 3626676..d2ebad1 100644 ---- a/sound/soc/aml/m8/aml_i2s_dai.c -+++ b/sound/soc/aml/m8/aml_i2s_dai.c -@@ -290,9 +290,8 @@ static int aml_dai_i2s_resume(struct snd_soc_dai *dai) - return 0; - } - --#define AML_DAI_I2S_RATES (SNDRV_PCM_RATE_8000_192000) --#define AML_DAI_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\ -- SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) -+#define AML_DAI_I2S_RATES SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000 -+#define AML_DAI_I2S_FORMATS SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE - - static struct snd_soc_dai_ops aml_dai_i2s_ops = { - .startup = aml_dai_i2s_startup, --- -1.8.3.1 - diff --git a/projects/WeTek_Hub/patches/linux/no_dev_console.patch b/projects/WeTek_Hub/patches/linux/no_dev_console.patch deleted file mode 100644 index df35a7ab9a..0000000000 --- a/projects/WeTek_Hub/patches/linux/no_dev_console.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/init/main.c b/init/main.c -index 9484f4b..db55edd 100644 ---- a/init/main.c -+++ b/init/main.c -@@ -880,8 +880,14 @@ static noinline void __init kernel_init_freeable(void) - do_basic_setup(); - - /* Open the /dev/console on the rootfs, this should never fail */ -- if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) -- pr_err("Warning: unable to open an initial console.\n"); -+ char *console = "/dev_console"; -+ -+ if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) { -+ sys_mknod(console, S_IFCHR|0600, (TTYAUX_MAJOR<<8)|1); -+ if (sys_open(console, O_RDWR, 0) < 0) -+ printk(KERN_WARNING "Warning: unable to open an initial console.\n"); -+ sys_unlink(console); -+ } - - (void) sys_dup(0); - (void) sys_dup(0); diff --git a/projects/WeTek_Hub/patches/linux/staging_rtl8712_rtl8712_avoid_lots_of_build_warnings.patch b/projects/WeTek_Hub/patches/linux/staging_rtl8712_rtl8712_avoid_lots_of_build_warnings.patch deleted file mode 100644 index 0ad0dc7884..0000000000 --- a/projects/WeTek_Hub/patches/linux/staging_rtl8712_rtl8712_avoid_lots_of_build_warnings.patch +++ /dev/null @@ -1,113 +0,0 @@ -From fa89009a1869844f9a9360eb07c45d457446ac0e Mon Sep 17 00:00:00 2001 -From: Arnd Bergmann -Date: Thu, 5 Jun 2014 22:48:15 +0200 -Subject: [PATCH] staging: rtl8712, rtl8712: avoid lots of build warnings - -commit 0c9f3a65c5eb7fe1fc611a22eb8a8b71ea865998 upstream. - -The rtl8712 driver has an 'extern inline' function that contains an -'if', which causes lots of warnings with CONFIG_PROFILE_ALL_BRANCHES -overriding the definition of 'if': - -drivers/staging/rtl8712/ieee80211.h:759:229: warning: '______f' is static but declared in inline function 'ieee80211_get_hdrlen' which is not static [enabled by default] - -This changes the driver to use 'static inline' instead, which happens -to be the correct annotation anyway. - -Signed-off-by: Arnd Bergmann -Cc: Larry Finger -Cc: Florian Schilhabel -Signed-off-by: Greg Kroah-Hartman ---- - drivers/staging/rtl8187se/ieee80211/ieee80211.h | 4 ++-- - drivers/staging/rtl8192u/ieee80211/ieee80211.h | 10 +++++----- - drivers/staging/rtl8712/ieee80211.h | 4 ++-- - 3 files changed, 9 insertions(+), 9 deletions(-) - -diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211.h b/drivers/staging/rtl8187se/ieee80211/ieee80211.h -index 09ffd9b..6ebdd3f 100644 ---- a/drivers/staging/rtl8187se/ieee80211/ieee80211.h -+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211.h -@@ -1460,12 +1460,12 @@ extern void ieee80211_sta_ps_send_null_frame(struct ieee80211_device *ieee, - - extern const long ieee80211_wlan_frequencies[]; - --extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee) -+static inline void ieee80211_increment_scans(struct ieee80211_device *ieee) - { - ieee->scans++; - } - --extern inline int ieee80211_get_scans(struct ieee80211_device *ieee) -+static inline int ieee80211_get_scans(struct ieee80211_device *ieee) - { - return ieee->scans; - } -diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h -index bc64f05..b1a0380 100644 ---- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h -+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h -@@ -2250,7 +2250,7 @@ static inline void *ieee80211_priv(struct net_device *dev) - return ((struct ieee80211_device *)netdev_priv(dev))->priv; - } - --extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) -+static inline int ieee80211_is_empty_essid(const char *essid, int essid_len) - { - /* Single white space is for Linksys APs */ - if (essid_len == 1 && essid[0] == ' ') -@@ -2266,7 +2266,7 @@ extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) - return 1; - } - --extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode) -+static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode) - { - /* - * It is possible for both access points and our device to support -@@ -2292,7 +2292,7 @@ extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mod - return 0; - } - --extern inline int ieee80211_get_hdrlen(u16 fc) -+static inline int ieee80211_get_hdrlen(u16 fc) - { - int hdrlen = IEEE80211_3ADDR_LEN; - -@@ -2578,12 +2578,12 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee); - - extern const long ieee80211_wlan_frequencies[]; - --extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee) -+static inline void ieee80211_increment_scans(struct ieee80211_device *ieee) - { - ieee->scans++; - } - --extern inline int ieee80211_get_scans(struct ieee80211_device *ieee) -+static inline int ieee80211_get_scans(struct ieee80211_device *ieee) - { - return ieee->scans; - } -diff --git a/drivers/staging/rtl8712/ieee80211.h b/drivers/staging/rtl8712/ieee80211.h -index da4000e..8269be8 100644 ---- a/drivers/staging/rtl8712/ieee80211.h -+++ b/drivers/staging/rtl8712/ieee80211.h -@@ -734,7 +734,7 @@ enum ieee80211_state { - #define IEEE_G (1<<2) - #define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) - --extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) -+static inline int ieee80211_is_empty_essid(const char *essid, int essid_len) - { - /* Single white space is for Linksys APs */ - if (essid_len == 1 && essid[0] == ' ') -@@ -748,7 +748,7 @@ extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) - return 1; - } - --extern inline int ieee80211_get_hdrlen(u16 fc) -+static inline int ieee80211_get_hdrlen(u16 fc) - { - int hdrlen = 24; - From 89db568f6b5ad8d7b6f082c779f025f2386ac8c8 Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Mon, 19 Sep 2016 21:52:29 +0200 Subject: [PATCH 6/7] projects/Odroid_C2: add amremote and lircd config --- .../filesystem/etc/amremote/remote.conf | 57 +++++++++++++++++++ .../filesystem/etc/lirc/lircd.conf.amremote | 34 +++++++++++ 2 files changed, 91 insertions(+) create mode 100644 projects/Odroid_C2/filesystem/etc/amremote/remote.conf create mode 100644 projects/Odroid_C2/filesystem/etc/lirc/lircd.conf.amremote diff --git a/projects/Odroid_C2/filesystem/etc/amremote/remote.conf b/projects/Odroid_C2/filesystem/etc/amremote/remote.conf new file mode 100644 index 0000000000..f1b937180b --- /dev/null +++ b/projects/Odroid_C2/filesystem/etc/amremote/remote.conf @@ -0,0 +1,57 @@ +#********************************************************************************************************* +#this file is configuration for each factory remote device +# work_mode 0 :software mode 1 :hardware mode +# repeat_enable 0 :disable repeat 1 :enable repeat +# +# factory_code each device has it's unique factory code. +# pattern:custom_code(16bit)+index_code(16bit) +# examble: 0xff000001 = 0xff00(custom cod) 0001 (index) +# +# release_delay unit:ms.release will report from kernel to user layer after this period of time +# from press or repeat triggered. +# +# debug_enable 0 :debug disable 1 :debug disable +# +# SW MODE: +# bit_count how many bits in each frame +# tw_leader_act time window for leader active +# tw_bit0 time window for bit0 time. +# tw_bit1 time window for bit1 time +# tw_repeat_leader time window for repeat leader +# REG +# reg_base_gen set value for PREG_IR_DEC_BASE_GEN +# reg_control set value for PREG_IR_DEC_CONTROL +# reg_leader_act set value for PREG_IR_DEC_LEADER_ACTIVE +# reg_leader_idle set value for PREG_IR_DEC_LEADER_IDLE +# reg_repeat_leader set value for PREG_IR_DEC_REPEAT_IDLE +# reg_bit0_time set value for PREG_IR_DEC_BIT0_TIME +#************************************************************************************************************* +#amlogic NEC remote +factory_code = 0x4db20001 +work_mode = 0 +repeat_enable = 1 +repeat_delay = 40 +repeat_peroid = 39 +release_delay = 121 +debug_enable = 1 + +up_key_scancode = 0xca +down_key_scancode = 0xd2 +left_key_scancode = 0x99 +right_key_scancode = 0xc1 +ok_key_scancode = 0xce + +key_begin + 0xdc 116 ; KEY_POWER + 0x88 113 ; KEY_MUTE + 0x82 102 ; KEY_HOME + 0xca 103 ; KEY_UP + 0xd2 108 ; KEY_DOWN + 0x99 105 ; KEY_LEFT + 0xc1 106 ; KEY_RIGHT + 0xce 28 ; KEY_ENTER + 0x9a 1 ; KEY_ESC + 0xc5 46 ; KEY_C + 0x80 115 ; KEY_VOLUMEUP + 0x81 114 ; KEY_VOLUMEDOWN +key_end diff --git a/projects/Odroid_C2/filesystem/etc/lirc/lircd.conf.amremote b/projects/Odroid_C2/filesystem/etc/lirc/lircd.conf.amremote new file mode 100644 index 0000000000..5bd1125445 --- /dev/null +++ b/projects/Odroid_C2/filesystem/etc/lirc/lircd.conf.amremote @@ -0,0 +1,34 @@ +begin remote + + name odroid_amremote + bits 16 + flags SPACE_ENC|CONST_LENGTH + eps 30 + aeps 100 + + header 9000 4500 + one 563 1687 + zero 563 562 + ptrail 563 + repeat 9000 2250 + pre_data_bits 16 + pre_data 0x4DB2 + gap 0 + suppress_repeat 1 + + begin codes + KEY_POWER 0x3BC4 + KEY_MUTE 0x11EE + KEY_HOME 0x41BE + KEY_ENTER 0x738C + KEY_LEFT 0x9966 + KEY_RIGHT 0x837C + KEY_UP 0x53AC + KEY_DOWN 0x4BB4 + KEY_BACK 0x59A6 + KEY_MENU 0xA35C + KEY_VOLUMEDOWN 0x817E + KEY_VOLUMEUP 0x01FE + end codes + +end remote From a3a662a16fc8cdd08136488e2588c8d163fb7391 Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Mon, 19 Sep 2016 21:52:29 +0200 Subject: [PATCH 7/7] projects/WeTek_Hub: add lircd config --- .../filesystem/etc/lirc/lircd.conf.amremote | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 projects/WeTek_Hub/filesystem/etc/lirc/lircd.conf.amremote diff --git a/projects/WeTek_Hub/filesystem/etc/lirc/lircd.conf.amremote b/projects/WeTek_Hub/filesystem/etc/lirc/lircd.conf.amremote new file mode 100644 index 0000000000..922d452c65 --- /dev/null +++ b/projects/WeTek_Hub/filesystem/etc/lirc/lircd.conf.amremote @@ -0,0 +1,34 @@ +begin remote + + name wetek_hub + bits 16 + flags SPACE_ENC|CONST_LENGTH + eps 30 + aeps 100 + + header 9000 4500 + one 563 1687 + zero 563 562 + ptrail 563 + repeat 9000 2250 + pre_data_bits 16 + pre_data 0xEE11 + gap 0 + suppress_repeat 1 + + begin codes + KEY_POWER 0x8F70 + KEY_HOME 0x4FB0 + KEY_MUTE 0xCF30 + KEY_ENTER 0x1FE0 + KEY_LEFT 0x6F90 + KEY_RIGHT 0xEF10 + KEY_UP 0x2FD0 + KEY_DOWN 0xAF50 + KEY_BACK 0x9F60 + KEY_MENU 0x5FA0 + KEY_VOLUMEUP 0xDF20 + KEY_VOLUMEDOWN 0x3FC0 + end codes + +end remote