Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3.8: add fix for HDMI no audio modes and a fallback HDMI no audio vir…
…tual cape Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
- Loading branch information
Showing
3 changed files
with
339 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
patches/hdmi/0011-tilcdc-Allow-non-audio-modes-when-we-don-t-support-t.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
From ed28737a7d10a623db35f4aaac78d72b5b44ed5b Mon Sep 17 00:00:00 2001 | ||
From: Pantelis Antoniou <panto@antoniou-consulting.com> | ||
Date: Tue, 4 Jun 2013 17:53:07 +0300 | ||
Subject: [PATCH 11/11] tilcdc: Allow non-audio modes when we don't support | ||
them. | ||
|
||
Allow non-audio modes on an audio capable monitor if we explicitly | ||
disable audio. | ||
|
||
Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com> | ||
--- | ||
drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 3 ++- | ||
1 file changed, 2 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c | ||
index 14cee74..5f5f464 100644 | ||
--- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c | ||
+++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c | ||
@@ -480,7 +480,8 @@ int tilcdc_crtc_mode_valid(struct drm_crtc *crtc, struct drm_display_mode *mode, | ||
is_cea_mode ? "true" : "false", | ||
can_output_audio ? "true" : "false" ); | ||
|
||
- if (edid && has_audio && !can_output_audio) { | ||
+ /* we only prune the mode if we ask for it */ | ||
+ if (audio && edid && has_audio && !can_output_audio) { | ||
DBG("Pruning mode : Does not support audio"); | ||
return MODE_BAD; | ||
} | ||
-- | ||
1.8.1.4 | ||
|
190 changes: 190 additions & 0 deletions
190
patches/resources/0005-bbb-Add-a-fall-back-non-audio-HDMI-cape.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
From fd763243cb8e021d299c5dcd2b3e5493c950d7fe Mon Sep 17 00:00:00 2001 | ||
From: Pantelis Antoniou <panto@antoniou-consulting.com> | ||
Date: Tue, 4 Jun 2013 17:54:45 +0300 | ||
Subject: [PATCH 5/6] bbb: Add a fall-back non-audio HDMI cape | ||
|
||
When a user cape hogs the audio, allow booting with a HDMI cape which | ||
only supports video. | ||
--- | ||
arch/arm/boot/dts/am335x-bone-common.dtsi | 21 +++++ | ||
firmware/Makefile | 5 +- | ||
firmware/capes/cape-boneblack-hdmin-00A0.dts | 112 +++++++++++++++++++++++++++ | ||
3 files changed, 136 insertions(+), 2 deletions(-) | ||
create mode 100644 firmware/capes/cape-boneblack-hdmin-00A0.dts | ||
|
||
diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi | ||
index ae407c3..aa95810 100644 | ||
--- a/arch/arm/boot/dts/am335x-bone-common.dtsi | ||
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi | ||
@@ -219,6 +219,17 @@ | ||
part-number = "BB-BONELT-HDMI"; | ||
}; | ||
|
||
+ /* Beaglebone black has it soldered on (but no audio) */ | ||
+ slot@102 { | ||
+ ti,cape-override; | ||
+ priority = <2>; | ||
+ compatible = "ti,beaglebone-black"; | ||
+ board-name = "Bone-Black-HDMIN"; | ||
+ version = "00A0"; | ||
+ manufacturer = "Texas Instruments"; | ||
+ part-number = "BB-BONELT-HDMIN"; | ||
+ }; | ||
+ | ||
}; | ||
|
||
/* mapping between board names and dtb objects */ | ||
@@ -349,6 +360,16 @@ | ||
dtbo = "BB-BONE-RS232-00A0.dtbo"; | ||
}; | ||
}; | ||
+ | ||
+ /* beaglebone black hdmi on board (No audio) */ | ||
+ cape@13 { | ||
+ part-number = "BB-BONELT-HDMIN"; | ||
+ version@00A0 { | ||
+ version = "00A0"; | ||
+ dtbo = "cape-boneblack-hdmin-00A0.dtbo"; | ||
+ }; | ||
+ }; | ||
+ | ||
}; | ||
}; | ||
|
||
diff --git a/firmware/Makefile b/firmware/Makefile | ||
index d82fb9b..062cfef 100644 | ||
--- a/firmware/Makefile | ||
+++ b/firmware/Makefile | ||
@@ -196,8 +196,9 @@ fw-shipped-$(CONFIG_CAPE_BEAGLEBONE_NIXIE) += \ | ||
# the weather cape | ||
fw-shipped-$(CONFIG_CAPE_BEAGLEBONE) += cape-bone-weather-00A0.dtbo | ||
|
||
-# the HDMI virtual cape on the beaglebone-black | ||
-fw-shipped-$(CONFIG_CAPE_BEAGLEBONE) += cape-boneblack-hdmi-00A0.dtbo | ||
+# the HDMI virtual capes on the beaglebone-black | ||
+fw-shipped-$(CONFIG_CAPE_BEAGLEBONE) += \ | ||
+ cape-boneblack-hdmi-00A0.dtbo cape-boneblack-hdmin-00A0.dtbo | ||
|
||
# the Tester cape (tester-side) | ||
fw-shipped-$(CONFIG_CAPE_BEAGLEBONE) += cape-bone-tester-00A0.dtbo | ||
diff --git a/firmware/capes/cape-boneblack-hdmin-00A0.dts b/firmware/capes/cape-boneblack-hdmin-00A0.dts | ||
new file mode 100644 | ||
index 0000000..44ae0ea | ||
--- /dev/null | ||
+++ b/firmware/capes/cape-boneblack-hdmin-00A0.dts | ||
@@ -0,0 +1,112 @@ | ||
+/* | ||
+* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ | ||
+* | ||
+* 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. | ||
+*/ | ||
+/dts-v1/; | ||
+/plugin/; | ||
+ | ||
+/ { | ||
+ compatible = "ti,beaglebone-black"; | ||
+ part-number = "BB-BONELT-HDMIN"; /* No audio */ | ||
+ version = "00A0"; | ||
+ | ||
+ /* state the resources this cape uses */ | ||
+ exclusive-use = | ||
+ /* the pin header uses */ | ||
+ "P8.45", /* lcd: lcd_data0 */ | ||
+ "P8.46", /* lcd: lcd_data1 */ | ||
+ "P8.43", /* lcd: lcd_data2 */ | ||
+ "P8.44", /* lcd: lcd_data3 */ | ||
+ "P8.41", /* lcd: lcd_data4 */ | ||
+ "P8.42", /* lcd: lcd_data5 */ | ||
+ "P8.39", /* lcd: lcd_data6 */ | ||
+ "P8.40", /* lcd: lcd_data7 */ | ||
+ "P8.37", /* lcd: lcd_data8 */ | ||
+ "P8.38", /* lcd: lcd_data9 */ | ||
+ "P8.36", /* lcd: lcd_data10 */ | ||
+ "P8.34", /* lcd: lcd_data11 */ | ||
+ "P8.35", /* lcd: lcd_data12 */ | ||
+ "P8.33", /* lcd: lcd_data13 */ | ||
+ "P8.31", /* lcd: lcd_data14 */ | ||
+ "P8.32", /* lcd: lcd_data15 */ | ||
+ "P8.27", /* lcd: lcd_vsync */ | ||
+ "P8.29", /* lcd: lcd_hsync */ | ||
+ "P8.28", /* lcd: lcd_pclk */ | ||
+ "P8.30", /* lcd: lcd_ac_bias_en */ | ||
+ /* the hardware IP uses */ | ||
+ "gpio1_27", | ||
+ "lcd"; | ||
+ | ||
+ fragment@0 { | ||
+ target = <&am33xx_pinmux>; | ||
+ __overlay__ { | ||
+ nxp_hdmi_bonelt_pins: nxp_hdmi_bonelt_pins { | ||
+ pinctrl-single,pins = < | ||
+ 0x1b0 0x03 /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */ | ||
+ 0xa0 0x08 /* lcd_data0.lcd_data0, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ | ||
+ 0xa4 0x08 /* lcd_data1.lcd_data1, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ | ||
+ 0xa8 0x08 /* lcd_data2.lcd_data2, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ | ||
+ 0xac 0x08 /* lcd_data3.lcd_data3, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ | ||
+ 0xb0 0x08 /* lcd_data4.lcd_data4, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ | ||
+ 0xb4 0x08 /* lcd_data5.lcd_data5, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ | ||
+ 0xb8 0x08 /* lcd_data6.lcd_data6, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ | ||
+ 0xbc 0x08 /* lcd_data7.lcd_data7, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ | ||
+ 0xc0 0x08 /* lcd_data8.lcd_data8, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ | ||
+ 0xc4 0x08 /* lcd_data9.lcd_data9, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ | ||
+ 0xc8 0x08 /* lcd_data10.lcd_data10, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ | ||
+ 0xcc 0x08 /* lcd_data11.lcd_data11, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ | ||
+ 0xd0 0x08 /* lcd_data12.lcd_data12, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ | ||
+ 0xd4 0x08 /* lcd_data13.lcd_data13, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ | ||
+ 0xd8 0x08 /* lcd_data14.lcd_data14, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ | ||
+ 0xdc 0x08 /* lcd_data15.lcd_data15, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */ | ||
+ 0xe0 0x00 /* lcd_vsync.lcd_vsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */ | ||
+ 0xe4 0x00 /* lcd_hsync.lcd_hsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */ | ||
+ 0xe8 0x00 /* lcd_pclk.lcd_pclk, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */ | ||
+ 0xec 0x00 /* lcd_ac_bias_en.lcd_ac_bias_en, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */ | ||
+ >; | ||
+ }; | ||
+ nxp_hdmi_bonelt_off_pins: nxp_hdmi_bonelt_off_pins { | ||
+ pinctrl-single,pins = < | ||
+ 0x1b0 0x03 /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */ | ||
+ >; | ||
+ }; | ||
+ }; | ||
+ }; | ||
+ | ||
+ fragment@2 { | ||
+ target = <&ocp>; | ||
+ __overlay__ { | ||
+ | ||
+ /* avoid stupid warning */ | ||
+ #address-cells = <1>; | ||
+ #size-cells = <1>; | ||
+ | ||
+ nxptda: nxptda@0 { | ||
+ compatible = "nxp,nxptda"; | ||
+ status = "okay"; | ||
+ }; | ||
+ | ||
+ hdmi { | ||
+ compatible = "tilcdc,slave"; | ||
+ i2c = <&i2c0>; | ||
+ pinctrl-names = "default", "off"; | ||
+ pinctrl-0 = <&nxp_hdmi_bonelt_pins>; | ||
+ pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>; | ||
+ }; | ||
+ | ||
+ fb { | ||
+ compatible = "ti,am33xx-tilcdc"; | ||
+ reg = <0x4830e000 0x1000>; | ||
+ interrupt-parent = <&intc>; | ||
+ interrupts = <36>; | ||
+ ti,hwmods = "lcdc"; | ||
+ ti,allow-non-reduced-blanking-modes; | ||
+ ti,allow-non-audio-modes; | ||
+ }; | ||
+ | ||
+ }; | ||
+ }; | ||
+}; | ||
-- | ||
1.8.1.4 | ||
|
118 changes: 118 additions & 0 deletions
118
patches/resources/0006-capemgr-Add-enable_partno-parameter.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
From ff5e80c6f4ed1a5c5220a7dddad7bb06cd20c0e8 Mon Sep 17 00:00:00 2001 | ||
From: Pantelis Antoniou <panto@antoniou-consulting.com> | ||
Date: Tue, 4 Jun 2013 19:42:45 +0300 | ||
Subject: [PATCH 6/6] capemgr: Add enable_partno parameter | ||
|
||
Add analogous option to disable_partno; this one doesn't require the presence of | ||
a base dts override. | ||
|
||
Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com> | ||
--- | ||
drivers/misc/cape/beaglebone/capemgr.c | 66 ++++++++++++++++++++++++++++++++++ | ||
1 file changed, 66 insertions(+) | ||
|
||
diff --git a/drivers/misc/cape/beaglebone/capemgr.c b/drivers/misc/cape/beaglebone/capemgr.c | ||
index 2820e39..b1a8b65 100644 | ||
--- a/drivers/misc/cape/beaglebone/capemgr.c | ||
+++ b/drivers/misc/cape/beaglebone/capemgr.c | ||
@@ -57,6 +57,13 @@ module_param(disable_partno, charp, 0444); | ||
MODULE_PARM_DESC(disable_partno, | ||
"Comma delimited list of PART-NUMBER[:REV] of disabled capes"); | ||
|
||
+/* enable capes */ | ||
+static char *enable_partno = NULL; | ||
+module_param(enable_partno, charp, 0444); | ||
+MODULE_PARM_DESC(enable_partno, | ||
+ "Comma delimited list of PART-NUMBER[:REV] of enabled capes"); | ||
+ | ||
+ | ||
struct bone_capemgr_info; | ||
|
||
struct slot_ee_attribute { | ||
@@ -1812,10 +1819,12 @@ bone_capemgr_probe(struct platform_device *pdev) | ||
struct device_node *slots_node, *capemaps_node, *node; | ||
struct device_node *eeprom_node; | ||
const char *part_number; | ||
+ const char *version; | ||
const char *board_name; | ||
const char *compatible_name; | ||
struct bone_capemap *capemap; | ||
int ret, len; | ||
+ char *wbuf, *s, *p, *e; | ||
|
||
/* we don't use platform_data at all; we require OF */ | ||
if (pnode == NULL) | ||
@@ -1996,6 +2005,62 @@ bone_capemgr_probe(struct platform_device *pdev) | ||
} | ||
slots_node = NULL; | ||
|
||
+ /* iterate over enable_partno (if there) */ | ||
+ if (enable_partno && strlen(enable_partno) > 0) { | ||
+ | ||
+ /* allocate a temporary buffer */ | ||
+ wbuf = devm_kzalloc(&pdev->dev, PAGE_SIZE, GFP_KERNEL); | ||
+ if (wbuf == NULL) { | ||
+ dev_err(&pdev->dev, "Failed to allocate temporary buffer\n"); | ||
+ ret = -ENOMEM; | ||
+ goto err_exit; | ||
+ } | ||
+ | ||
+ /* add any enable_partno capes */ | ||
+ s = enable_partno; | ||
+ while (*s) { | ||
+ /* form is PART[:REV],PART.. */ | ||
+ p = strchr(s, ','); | ||
+ if (p == NULL) | ||
+ e = s + strlen(s); | ||
+ else | ||
+ e = p; | ||
+ | ||
+ /* copy to temp buffer */ | ||
+ len = e - s; | ||
+ if (len >= PAGE_SIZE - 1) | ||
+ len = PAGE_SIZE - 1; | ||
+ memcpy(wbuf, s, len); | ||
+ wbuf[len] = '\0'; | ||
+ | ||
+ /* move to the next */ | ||
+ s = *e ? e + 1 : e; | ||
+ | ||
+ /* now split the rev part */ | ||
+ p = strchr(wbuf, ':'); | ||
+ if (p != NULL) | ||
+ *p++ = '\0'; | ||
+ | ||
+ part_number = wbuf; | ||
+ version = p; | ||
+ | ||
+ dev_info(&pdev->dev, "enabled_partno part_number '%s', version '%s'\n", | ||
+ part_number, version ? version : "N/A"); | ||
+ | ||
+ /* only immediate slots are allowed here */ | ||
+ slot = bone_capemgr_add_slot(info, NULL, | ||
+ part_number, version); | ||
+ | ||
+ /* we continue even in case of an error */ | ||
+ if (IS_ERR_OR_NULL(slot)) { | ||
+ dev_warn(&pdev->dev, "Failed to add slot #%d\n", | ||
+ atomic_read(&info->next_slot_nr) - 1); | ||
+ } | ||
+ } | ||
+ | ||
+ devm_kfree(&pdev->dev, wbuf); | ||
+ } | ||
+ | ||
pm_runtime_enable(&pdev->dev); | ||
ret = pm_runtime_get_sync(&pdev->dev); | ||
if (IS_ERR_VALUE(ret)) { | ||
@@ -2009,6 +2074,7 @@ bone_capemgr_probe(struct platform_device *pdev) | ||
|
||
/* now load each (take lock to be sure */ | ||
mutex_lock(&info->slots_list_mutex); | ||
+ | ||
list_for_each_entry(slot, &info->slot_list, node) { | ||
|
||
/* if matches the disabled ones skip */ | ||
-- | ||
1.8.1.4 | ||
|