From 6f97fb3c1c98e5bdb85414929171ec3d2803e3d5 Mon Sep 17 00:00:00 2001 From: Chirag Parmar Date: Wed, 21 Jan 2026 15:00:34 +0530 Subject: [PATCH 1/8] board: mecha: add hdmi and extension detection gpio developed-by: Pratham Malaviya Signed-off-by: Chirag Parmar --- .../boot/dts/freescale/imx8mp-mecha-comet.dts | 65 ++++++++++++++++++- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts b/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts index 1e29eb202242..b0011df7a296 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts @@ -6,8 +6,8 @@ /dts-v1/; //#include -//#include -//#include +#include +#include #include "imx8mp.dtsi" / { @@ -110,6 +110,13 @@ }; }; + sound-hdmi { + compatible = "fsl,imx-audio-hdmi"; + model = "audio-hdmi"; + audio-cpu = <&aud2htx>; + hdmi-out; + }; + usb0_ss_mux: ptn36043 { compatible = "nxp,ptn36043"; pinctrl-names = "default"; @@ -168,6 +175,17 @@ }; }; + Comet-Extension { + compatible = "gpio-keys"; + + keypad-slide { + label = "Comet Extension Keypad Slide"; + linux,input-type = ; + linux,code = ; + gpios = <&gpio4 23 GPIO_ACTIVE_HIGH>; + }; + }; + }; &A53_0 { @@ -214,6 +232,30 @@ dr_mode = "host"; }; +&irqsteer_hdmi { + status = "okay"; +}; + +&hdmi_blk_ctrl { + status = "okay"; +}; + +&hdmi_pavi { + status = "okay"; +}; + +&hdmi { + status = "okay"; +}; + +&hdmiphy { + status = "okay"; +}; + +&aud2htx { + status = "okay"; +}; + &wdog1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_wdog>; @@ -660,6 +702,17 @@ status = "okay"; }; +&lcdif2 { + status = "disabled"; +}; + +&lcdif3 { + status = "okay"; + + thres-low = <1 2>; /* (FIFO * 1 / 2) */ + thres-high = <3 4>; /* (FIFO * 3 / 4) */ +}; + &mipi_dsi { samsung,esc-clock-frequency = <16000000>; status = "okay"; @@ -1052,4 +1105,12 @@ >; }; + pinctrl_hog: hoggrp { + fsl,pins = < + MX8MP_IOMUXC_HDMI_DDC_SCL__HDMIMIX_HDMI_SCL 0x400001c2 + MX8MP_IOMUXC_HDMI_DDC_SDA__HDMIMIX_HDMI_SDA 0x400001c2 + MX8MP_IOMUXC_HDMI_HPD__HDMIMIX_HDMI_HPD 0x40000010 + MX8MP_IOMUXC_HDMI_CEC__HDMIMIX_HDMI_CEC 0x40000010 + >; + }; }; From 34b852b8c41f1594e190704fd51c10659ba84b63 Mon Sep 17 00:00:00 2001 From: Chirag Parmar Date: Thu, 22 Jan 2026 18:35:56 +0530 Subject: [PATCH 2/8] board: mecha: update linux input key code for Comet-Extension Signed-off-by: Chirag Parmar --- arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts b/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts index b0011df7a296..88f8b61ba66a 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts @@ -180,8 +180,8 @@ keypad-slide { label = "Comet Extension Keypad Slide"; - linux,input-type = ; - linux,code = ; + linux,input-type = ; + linux,code = ; gpios = <&gpio4 23 GPIO_ACTIVE_HIGH>; }; }; From d7dcc6d9ec35dda0a052799a40d842a4db8df381 Mon Sep 17 00:00:00 2001 From: Advait Dhamorikar Date: Fri, 23 Jan 2026 12:09:35 +0530 Subject: [PATCH 3/8] board: mecha: update keycode addressing --- arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts b/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts index 88f8b61ba66a..4104f7bd52f6 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts @@ -148,7 +148,8 @@ keypad-slide { label = "Home-Button"; - linux,code = ; + linux,input-type = ; + linux,code = ; gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>; }; }; @@ -159,7 +160,7 @@ keypad-slide { label = "VOL+"; linux,input-type = ; - linux,code = <103>; + linux,code = ; gpios = <&gpio2 07 GPIO_ACTIVE_HIGH>; }; }; @@ -170,7 +171,7 @@ keypad-slide { label = "VOL-"; linux,input-type = ; - linux,code = <108>; + linux,code = ; gpios = <&gpio2 8 GPIO_ACTIVE_HIGH>; }; }; From b5e4e9271f058b8a812bcb59e4c5830819d50bfa Mon Sep 17 00:00:00 2001 From: Chirag Parmar Date: Fri, 30 Jan 2026 16:42:46 +0530 Subject: [PATCH 4/8] board: mecha: add headphone-jack detection disable audit logs developed-by: Pratham Malaviya Signed-off-by: Chirag Parmar --- .../boot/dts/freescale/imx8mp-mecha-comet.dts | 20 +++++++-- arch/arm64/configs/mecha_v8_defconfig | 11 +++-- sound/soc/codecs/max98090.c | 45 ++++++++++++++++--- 3 files changed, 62 insertions(+), 14 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts b/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts index 4104f7bd52f6..a9a788a660a5 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts @@ -79,8 +79,8 @@ "IN1", "MICBIAS", "MIC1","IN1", "MIC2","IN1", - "Speakers", "SPKL", - "Speakers", "SPKR", + //"Speakers", "SPKL", + //"Speakers", "SPKR", /* DMIC-3 Routings */ "DMICL", "DMIC Mux", @@ -150,6 +150,7 @@ label = "Home-Button"; linux,input-type = ; linux,code = ; + wakeup-source; gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>; }; }; @@ -375,6 +376,7 @@ touchctl: focaltech@38 { compatible = "focaltech,fts"; reg = <0x38>; + wakeup-source; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_touch_i2c>; interrupt-parent = <&gpio4>; @@ -481,12 +483,14 @@ #sound-dai-cells = <0>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_sai3>; + pinctrl-1 = <&pinctrl_codec>; compatible = "maxim,max98091"; reg = <0x10>; clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_SAI3_MCLK1>; - interrupt-parent = <&gpio1>; - interrupts = <8 IRQ_TYPE_LEVEL_LOW>; /* SODIMM_218 */ + interrupt-parent = <&gpio4>; + interrupts = <15 IRQ_TYPE_LEVEL_LOW>; clock-names = "mclk"; + status = "okay"; }; bq27441: fuel-gauge@55 { @@ -794,6 +798,7 @@ &iomuxc { pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_hog>; pinctrl_i2c1: i2c1grp { fsl,pins = < @@ -1114,4 +1119,11 @@ MX8MP_IOMUXC_HDMI_CEC__HDMIMIX_HDMI_CEC 0x40000010 >; }; + + pinctrl_codec: codecgrp { + fsl,pins = < + MX8MP_IOMUXC_SAI1_TXD3__GPIO4_IO15 0x1c4 + >; + }; + }; diff --git a/arch/arm64/configs/mecha_v8_defconfig b/arch/arm64/configs/mecha_v8_defconfig index 68fb92731e4a..aa5af91445a4 100644 --- a/arch/arm64/configs/mecha_v8_defconfig +++ b/arch/arm64/configs/mecha_v8_defconfig @@ -1,6 +1,6 @@ CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y -CONFIG_AUDIT=y + CONFIG_NO_HZ_IDLE=y CONFIG_HIGH_RES_TIMERS=y CONFIG_BPF_SYSCALL=y @@ -917,7 +917,7 @@ CONFIG_BCM_SBA_RAID=m CONFIG_FSL_EDMA=y CONFIG_FSL_QDMA=m CONFIG_FSL_EDMA_V3=y -CONFIG_IMX_SDMA=y + CONFIG_MV_XOR_V2=y CONFIG_MXS_DMA=y CONFIG_MXC_PXP_V3=y @@ -1230,7 +1230,7 @@ CONFIG_BLK_DEV_RAM_SIZE=1020000 CONFIG_U_SERIAL_CONSOLE=y CONFIG_USB_MASS_STORAGE=y -CONFIG_IMX_SDMA=n + # MIPI DSI Display CONFIG_DRM_DISPLAY_CONNECTOR=y @@ -1267,7 +1267,12 @@ CONFIG_TYPEC_TPS6598X=y CONFIG_TRACING=y CONFIG_EXTCON_USBC_TUSB320=y +# NXP wifi driver CONFIG_MWIFIEX=m CONFIG_MXC_GPU_VIV=n CONFIG_DRM_ETNAVIV=y + +# disable audit logs +CONFIG_AUDIT=n + diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index 2adf744c6526..a2f0a4154681 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c @@ -1211,10 +1211,10 @@ static const struct snd_soc_dapm_widget max98090_dapm_widgets[] = { SND_SOC_DAPM_PGA("HP Right Out", M98090_REG_OUTPUT_ENABLE, M98090_HPREN_SHIFT, 0, NULL, 0), - SND_SOC_DAPM_PGA("SPK Left Out", M98090_REG_OUTPUT_ENABLE, - M98090_SPLEN_SHIFT, 0, NULL, 0), - SND_SOC_DAPM_PGA("SPK Right Out", M98090_REG_OUTPUT_ENABLE, - M98090_SPREN_SHIFT, 0, NULL, 0), + // SND_SOC_DAPM_PGA("SPK Left Out", M98090_REG_OUTPUT_ENABLE, + // M98090_SPLEN_SHIFT, 0, NULL, 0), + // SND_SOC_DAPM_PGA("SPK Right Out", M98090_REG_OUTPUT_ENABLE, + // M98090_SPREN_SHIFT, 0, NULL, 0), SND_SOC_DAPM_PGA("RCV Left Out", M98090_REG_OUTPUT_ENABLE, M98090_RCVLEN_SHIFT, 0, NULL, 0), @@ -1223,8 +1223,8 @@ static const struct snd_soc_dapm_widget max98090_dapm_widgets[] = { SND_SOC_DAPM_OUTPUT("HPL"), SND_SOC_DAPM_OUTPUT("HPR"), - SND_SOC_DAPM_OUTPUT("SPKL"), - SND_SOC_DAPM_OUTPUT("SPKR"), + // SND_SOC_DAPM_OUTPUT("SPKL"), + // SND_SOC_DAPM_OUTPUT("SPKR"), SND_SOC_DAPM_OUTPUT("RCVL"), SND_SOC_DAPM_OUTPUT("RCVR"), }; @@ -2152,7 +2152,7 @@ static void max98090_jack_work(struct work_struct *work) struct snd_soc_component *component = max98090->component; int status = 0; int reg; - + unsigned int value = 0; /* Read a second time */ if (max98090->jack_state == M98090_JACK_STATE_NO_HEADSET) { @@ -2224,6 +2224,37 @@ static void max98090_jack_work(struct work_struct *work) break; } + /* Headphone & Headset Detection logic */ + + if (status & (SND_JACK_HEADSET | SND_JACK_HEADPHONE)) { + dev_dbg(component->dev,"TURN OFF SPEAKER O/P\n"); + + regmap_read(max98090->regmap,M98090_REG_OUTPUT_ENABLE, &value); + + dev_info(component->dev,"OUTPUT Register Value : 0x%x\n",value); + + value = (value & + ~(M98090_SPLEN_MASK | M98090_SPREN_MASK)) | + (M98090_HPLEN_MASK | M98090_HPREN_MASK) ; + + regmap_write(max98090->regmap,M98090_REG_OUTPUT_ENABLE,value); + + dev_info(component->dev,"Speaker outputs disabled. New value: 0x%x\n", value); + } + + if (status == 0) { + regmap_read(max98090->regmap,M98090_REG_OUTPUT_ENABLE, &value); + + if ((value & (M98090_SPLEN_MASK | M98090_SPREN_MASK)) == 0) { + value |= (M98090_SPLEN_MASK | M98090_SPREN_MASK); + + regmap_write(max98090->regmap,M98090_REG_OUTPUT_ENABLE, + value); + dev_info(component->dev,"Speakers enabled. OUTPUT_ENABLE = 0x%x\n", value); + } + } + /**************************************/ + snd_soc_jack_report(max98090->jack, status, SND_JACK_HEADSET | SND_JACK_BTN_0); } From 729f9ff06d1360ef4c388a0018c5bc7dd4c0d46d Mon Sep 17 00:00:00 2001 From: Chirag Parmar Date: Fri, 30 Jan 2026 18:07:04 +0530 Subject: [PATCH 5/8] board: mecha: add support of usb data on usb-power port type-c interface developed-by: Pratham Malaviya Signed-off-by: Chirag Parmar --- .../boot/dts/freescale/imx8mp-mecha-comet.dts | 37 ++++++++++++++++++- drivers/usb/typec/tipd/core.c | 7 ++-- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts b/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts index a9a788a660a5..37a742bf2d42 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts @@ -143,6 +143,19 @@ }; }; + usb_pwr_mux: ptn36043_2 { + compatible = "nxp,ptn36043"; + pinctrl-names = "default"; + switch-gpios = <&gpio4 1 GPIO_ACTIVE_LOW>; + orientation-switch; + + port { + usb_pwr_sw_ep: endpoint { + remote-endpoint = <&usb_pwr_sw_ss>; + }; + }; + }; + Home-button { compatible = "gpio-keys"; @@ -217,8 +230,12 @@ &usb_dwc3_0 { status = "okay"; dr_mode = "otg"; - role-switch-default-mode = "none"; usb-role-switch; + port { + usb0_pwr_ep: endpoint { + remote-endpoint = <&usb_pwr_ep>; + }; + }; }; &usb3_phy1 { @@ -559,6 +576,24 @@ self-powered; data-role = "dual"; power-role = "dual"; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + usb_pwr_ep: endpoint { + remote-endpoint = <&usb0_pwr_ep>; + }; + }; + + port@1 { + reg = <1>; + usb_pwr_sw_ss: endpoint { + remote-endpoint = <&usb_pwr_sw_ep>; + }; + }; + }; }; }; diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index 7ee721a877c1..7087a05430f7 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -1389,7 +1389,8 @@ static int tps6598x_probe(struct i2c_client *client) tps->role_sw = fwnode_usb_role_switch_get(fwnode); if (IS_ERR(tps->role_sw)) { ret = PTR_ERR(tps->role_sw); - goto err_fwnode_put; + //goto err_fwnode_put; + return ret; } ret = devm_tps6598_psy_register(tps); @@ -1443,8 +1444,8 @@ static int tps6598x_probe(struct i2c_client *client) typec_unregister_port(tps->port); err_role_put: usb_role_switch_put(tps->role_sw); -err_fwnode_put: - fwnode_handle_put(fwnode); +//err_fwnode_put: +// fwnode_handle_put(fwnode); err_clear_mask: tps6598x_write64(tps, TPS_REG_INT_MASK1, 0); err_reset_controller: From f0bfc289ba31699b36b93175731a48104728239e Mon Sep 17 00:00:00 2001 From: Chirag Parmar Date: Wed, 18 Feb 2026 17:26:02 +0530 Subject: [PATCH 6/8] board: mecha: add pcie node developed-by: Pratham Malaviya Signed-off-by: Chirag Parmar --- .../boot/dts/freescale/imx8mp-mecha-comet.dts | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts b/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts index 37a742bf2d42..f4ed92d8e301 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-mecha-comet.dts @@ -5,7 +5,7 @@ /dts-v1/; -//#include +#include #include #include #include "imx8mp.dtsi" @@ -782,6 +782,20 @@ }; }; +&pcie_phy { + fsl,refclk-pad-mode = ; + clocks = <&hsio_blk_ctrl>; + clock-names = "ref"; + status = "okay"; +}; + +&pcie { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pcie0>; + reset-gpio = <&gpio1 24 GPIO_ACTIVE_LOW>; + status = "okay"; +}; + &sai3 { #sound-dai-cells = <0>; assigned-clocks = <&clk IMX8MP_CLK_SAI3>; @@ -1161,4 +1175,10 @@ >; }; + pinctrl_pcie0: pci0grp { + fsl,pins = < + MX8MP_IOMUXC_ENET_RX_CTL__GPIO1_IO24 0x1c4 + MX8MP_IOMUXC_UART4_RXD__PCIE_CLKREQ_B 0x1c4 + >; + }; }; From ab1719775e4c8d8fd6f42f358210eccf4a0dd4b9 Mon Sep 17 00:00:00 2001 From: Chirag Parmar Date: Wed, 18 Feb 2026 17:39:55 +0530 Subject: [PATCH 7/8] board: mecha: add config for waydroid Signed-off-by: Chirag Parmar --- arch/arm64/configs/mecha_v8_defconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/configs/mecha_v8_defconfig b/arch/arm64/configs/mecha_v8_defconfig index aa5af91445a4..c2ca4d6a37bb 100644 --- a/arch/arm64/configs/mecha_v8_defconfig +++ b/arch/arm64/configs/mecha_v8_defconfig @@ -1276,3 +1276,10 @@ CONFIG_DRM_ETNAVIV=y # disable audit logs CONFIG_AUDIT=n +CONFIG_ANDROID_BINDER_IPC=y +CONFIG_PSI=y +CONFIG_PSI_DEFAULT_DISABLED=n +CONFIG_MEMCG_SWAP=y +CONFIG_MEMCG_KMEM=y +CONFIG_SLUB_MEMCG_SYSFS_ON=y + From 1ffe55edc84118cbe5ebf2117ae34c251871c3d9 Mon Sep 17 00:00:00 2001 From: Chirag Parmar Date: Fri, 20 Feb 2026 14:53:35 +0530 Subject: [PATCH 8/8] board: mecha: add config Signed-off-by: Chirag Parmar --- arch/arm64/configs/mecha_v8_defconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/configs/mecha_v8_defconfig b/arch/arm64/configs/mecha_v8_defconfig index c2ca4d6a37bb..f2b862316674 100644 --- a/arch/arm64/configs/mecha_v8_defconfig +++ b/arch/arm64/configs/mecha_v8_defconfig @@ -1282,4 +1282,8 @@ CONFIG_PSI_DEFAULT_DISABLED=n CONFIG_MEMCG_SWAP=y CONFIG_MEMCG_KMEM=y CONFIG_SLUB_MEMCG_SYSFS_ON=y +CONFIG_ANDROID=y +CONFIG_ANDROID_BINDER_IPC=y +CONFIG_ANDROID_BINDERFS=y +CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder,anbox-binder,anbox-hwbinder,anbox-vndbinder"