linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 1/2] pmic-cpcap: add motorola,droid3 compatible
       [not found] <20211212230459.13579-1-merlijn@wizzup.org>
@ 2021-12-12 23:04 ` Merlijn Wajer
  2021-12-13  5:57   ` Tony Lindgren
  2021-12-12 23:04 ` [RFC PATCH 2/2] Droid3: add initial DTS Merlijn Wajer
  1 sibling, 1 reply; 8+ messages in thread
From: Merlijn Wajer @ 2021-12-12 23:04 UTC (permalink / raw)
  To: merlijn
  Cc: Ivaylo Dimitrov, Dev Null, Tony Lindgren, Sebastian Reichel,
	linux-omap, Kevin Hilman, Russell King, linux-arm-kernel,
	linux-kernel

The Droid 3 and the Bionic appear to share the same hardware, so add
the compatible for the Droid 3 as well.

Signed-off-by: Merlijn Wajer <merlijn@wizzup.org>
---
 arch/arm/mach-omap2/pmic-cpcap.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/pmic-cpcap.c b/arch/arm/mach-omap2/pmic-cpcap.c
index 668dc84fd31e..b9188dde13b9 100644
--- a/arch/arm/mach-omap2/pmic-cpcap.c
+++ b/arch/arm/mach-omap2/pmic-cpcap.c
@@ -245,7 +245,8 @@ int __init omap4_cpcap_init(void)
 	voltdm = voltdm_lookup("mpu");
 	omap_voltage_register_pmic(voltdm, &omap443x_max8952_mpu);
 
-	if (of_machine_is_compatible("motorola,droid-bionic")) {
+	if (of_machine_is_compatible("motorola,droid-bionic") ||
+	    of_machine_is_compatible("motorola,droid3")) {
 		voltdm = voltdm_lookup("core");
 		omap_voltage_register_pmic(voltdm, &omap_cpcap_core);
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [RFC PATCH 2/2] Droid3: add initial DTS
       [not found] <20211212230459.13579-1-merlijn@wizzup.org>
  2021-12-12 23:04 ` [RFC PATCH 1/2] pmic-cpcap: add motorola,droid3 compatible Merlijn Wajer
@ 2021-12-12 23:04 ` Merlijn Wajer
  2021-12-13  6:01   ` Tony Lindgren
  2021-12-19 13:17   ` Pavel Machek
  1 sibling, 2 replies; 8+ messages in thread
From: Merlijn Wajer @ 2021-12-12 23:04 UTC (permalink / raw)
  To: merlijn
  Cc: Ivaylo Dimitrov, Dev Null, Tony Lindgren, Sebastian Reichel,
	linux-omap, Arnd Bergmann, Olof Johansson, soc, Rob Herring,
	Benoît Cousson, Kees Cook, Anton Vorontsov, Colin Cross,
	Tony Luck, linux-arm-kernel, devicetree, linux-kernel

Not everything works yet, but a lot does work:

* serial
* display
* keyboard
* touchscreen
* slider/power button

What doesn't work yet:

* display backlight
* keyboard backlight

Signed-off-by: Merlijn Wajer <merlijn@wizzup.org>
---
 arch/arm/boot/dts/Makefile                    |   1 +
 .../boot/dts/motorola-mapphone-common.dtsi    |   4 +-
 arch/arm/boot/dts/omap4-droid3-xt862.dts      | 163 ++++++++++++++++++
 3 files changed, 166 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap4-droid3-xt862.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 7e0934180724..7ea8441817e5 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -874,6 +874,7 @@ dtb-$(CONFIG_SOC_AM33XX) += \
 	am335x-osd3358-sm-red.dtb
 dtb-$(CONFIG_ARCH_OMAP4) += \
 	omap4-droid-bionic-xt875.dtb \
+	omap4-droid3-xt862.dtb \
 	omap4-droid4-xt894.dtb \
 	omap4-duovero-parlor.dtb \
 	omap4-kc1.dtb \
diff --git a/arch/arm/boot/dts/motorola-mapphone-common.dtsi b/arch/arm/boot/dts/motorola-mapphone-common.dtsi
index bf18ff33d900..d0d1a1b1676c 100644
--- a/arch/arm/boot/dts/motorola-mapphone-common.dtsi
+++ b/arch/arm/boot/dts/motorola-mapphone-common.dtsi
@@ -19,7 +19,7 @@ aliases {
 	 * We seem to have only 1021 MB accessible, 1021 - 1022 is locked,
 	 * then 1023 - 1024 seems to contain mbm.
 	 */
-	memory {
+	memory0: memory {
 		device_type = "memory";
 		reg = <0x80000000 0x3fd00000>;	/* 1021 MB */
 	};
@@ -35,7 +35,7 @@ reserved-memory {
 		 * first 512K of that and just overwrite the rest and configure
 		 * only 384K instead of 2M.
 		 */
-		ramoops@a0080000 {
+		ramoops0: ramoops@a0080000 {
 			compatible = "ramoops";
 			reg = <0xa0080000 0x60000>;
 			record-size = <0x20000>;
diff --git a/arch/arm/boot/dts/omap4-droid3-xt862.dts b/arch/arm/boot/dts/omap4-droid3-xt862.dts
new file mode 100644
index 000000000000..f3a7175301ec
--- /dev/null
+++ b/arch/arm/boot/dts/omap4-droid3-xt862.dts
@@ -0,0 +1,163 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/dts-v1/;
+
+#include "motorola-mapphone-common.dtsi"
+
+/ {
+	model = "Motorola Droid 3 XT862";
+	compatible = "motorola,droid3", "ti,omap4430", "ti,omap4";
+
+	/*
+	 * We use pad 0x4a100116 abe_dmic_din3.gpio_122 as the irq instead
+	 * of the gpio interrupt to avoid lost events in deeper idle states.
+	 */
+	gpio_keys {
+		compatible = "gpio-keys";
+
+		slider {
+			label = "Keypad Slide";
+			interrupts-extended = <&omap4_pmx_core 0xd6>;
+			gpios = <&gpio4 26 GPIO_ACTIVE_HIGH>; /* gpio122 */
+			linux,input-type = <EV_SW>;
+			linux,code = <SW_KEYPAD_SLIDE>;
+			linux,can-disable;
+			/* Value above 7.95ms for no GPIO hardware debounce */
+			debounce-interval = <10>;
+		};
+	};
+};
+
+// Do don't know if pstore is supported, but the current config causes panics,
+// so delete the node for now
+/delete-node/ &ramoops0;
+
+&memory0 {
+	reg = <0x80000000 0x1fd00000>;	/* 509 MB */
+};
+
+&dsi1_out_ep {
+	lanes = <1 0 3 2 5 4>;
+};
+
+&i2c1 {
+	led-controller@38 {
+		compatible = "ti,lm3532";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <0x38>;
+
+		enable-gpios = <&gpio6 12 GPIO_ACTIVE_HIGH>;
+
+		ramp-up-us = <1024>;
+		ramp-down-us = <8193>;
+
+		backlight_led: led@0 {
+			reg = <0>;
+			led-sources = <2>;
+			ti,led-mode = <0>;
+			label = ":backlight";
+		};
+
+		led@1 {
+			reg = <1>;
+			led-sources = <1>;
+			ti,led-mode = <0>;
+			label = ":kbd_backlight";
+		};
+	};
+};
+
+&i2c4 {
+	kxtf9: accelerometer@f {
+		compatible = "kionix,kxtf9";
+		reg = <0x0f>;
+
+		vdd-supply = <&vhvio>;
+
+		interrupt-parent = <&gpio2>;
+		interrupts = <2 IRQ_TYPE_EDGE_RISING>;
+
+		rotation-matrix = "1", "0", "0",
+				  "0", "1", "0",
+				  "0", "0", "1";
+	};
+};
+
+&aes2_target {
+	status = "disabled";
+};
+
+&keypad {
+	keypad,num-rows = <8>;
+	keypad,num-columns = <8>;
+	linux,keymap = <
+
+	/* Row 1 */
+	MATRIX_KEY(0, 2, KEY_1)
+	MATRIX_KEY(0, 6, KEY_2)
+	MATRIX_KEY(2, 3, KEY_3)
+	MATRIX_KEY(0, 7, KEY_4)
+	MATRIX_KEY(0, 4, KEY_5)
+	MATRIX_KEY(5, 5, KEY_6)
+	MATRIX_KEY(0, 1, KEY_7)
+	MATRIX_KEY(0, 5, KEY_8)
+	MATRIX_KEY(0, 0, KEY_9)
+	MATRIX_KEY(1, 6, KEY_0)
+
+	/* Row 2 */
+	MATRIX_KEY(3, 4, KEY_APOSTROPHE)
+	MATRIX_KEY(7, 6, KEY_Q)
+	MATRIX_KEY(7, 7, KEY_W)
+	MATRIX_KEY(7, 2, KEY_E)
+	MATRIX_KEY(1, 0, KEY_R)
+	MATRIX_KEY(4, 4, KEY_T)
+	MATRIX_KEY(1, 2, KEY_Y)
+	MATRIX_KEY(6, 7, KEY_U)
+	MATRIX_KEY(2, 2, KEY_I)
+	MATRIX_KEY(5, 6, KEY_O)
+	MATRIX_KEY(3, 7, KEY_P)
+	MATRIX_KEY(6, 5, KEY_BACKSPACE)
+
+	/* Row 3 */
+	MATRIX_KEY(5, 4, KEY_TAB)
+	MATRIX_KEY(7, 5, KEY_A)
+	//MATRIX_KEY(5, 7, KEY_A)
+	MATRIX_KEY(2, 7, KEY_S)
+	MATRIX_KEY(7, 0, KEY_D)
+	MATRIX_KEY(2, 6, KEY_F)
+	MATRIX_KEY(6, 2, KEY_G)
+	MATRIX_KEY(6, 6, KEY_H)
+	MATRIX_KEY(1, 4, KEY_J)
+	MATRIX_KEY(3, 1, KEY_K)
+	MATRIX_KEY(2, 1, KEY_L)
+	MATRIX_KEY(4, 6, KEY_ENTER)
+
+	/* Row 4 */
+	MATRIX_KEY(3, 6, KEY_LEFTSHIFT)		/* KEY_CAPSLOCK */
+	MATRIX_KEY(6, 1, KEY_Z)
+	MATRIX_KEY(7, 4, KEY_X)
+	MATRIX_KEY(5, 1, KEY_C)
+	MATRIX_KEY(1, 7, KEY_V)
+	MATRIX_KEY(2, 4, KEY_B)
+	MATRIX_KEY(4, 1, KEY_N)
+	MATRIX_KEY(1, 1, KEY_M)
+	MATRIX_KEY(3, 5, KEY_COMMA)
+	MATRIX_KEY(5, 2, KEY_DOT)
+	MATRIX_KEY(6, 3, KEY_UP)
+	MATRIX_KEY(7, 3, KEY_OK)
+
+	/* Row 5 */
+	MATRIX_KEY(2, 5, KEY_LEFTCTRL)		/* KEY_LEFTSHIFT */
+	MATRIX_KEY(4, 5, KEY_LEFTALT)		/* SYM */
+	MATRIX_KEY(6, 0, KEY_MINUS)
+	MATRIX_KEY(4, 7, KEY_EQUAL)
+	MATRIX_KEY(1, 5, KEY_SPACE)
+	MATRIX_KEY(3, 2, KEY_SLASH)
+	MATRIX_KEY(4, 3, KEY_LEFT)
+	MATRIX_KEY(5, 3, KEY_DOWN)
+	MATRIX_KEY(3, 3, KEY_RIGHT)
+
+	MATRIX_KEY(5, 0, KEY_VOLUMEUP)
+	MATRIX_KEY(3, 0, KEY_VOLUMEDOWN)
+	>;
+};
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [RFC PATCH 1/2] pmic-cpcap: add motorola,droid3 compatible
  2021-12-12 23:04 ` [RFC PATCH 1/2] pmic-cpcap: add motorola,droid3 compatible Merlijn Wajer
@ 2021-12-13  5:57   ` Tony Lindgren
  2021-12-13 10:37     ` Merlijn Wajer
  0 siblings, 1 reply; 8+ messages in thread
From: Tony Lindgren @ 2021-12-13  5:57 UTC (permalink / raw)
  To: Merlijn Wajer
  Cc: Ivaylo Dimitrov, Dev Null, Sebastian Reichel, linux-omap,
	Kevin Hilman, Russell King, linux-arm-kernel, linux-kernel

* Merlijn Wajer <merlijn@wizzup.org> [211212 23:00]:
> The Droid 3 and the Bionic appear to share the same hardware, so add
> the compatible for the Droid 3 as well.
> 
> Signed-off-by: Merlijn Wajer <merlijn@wizzup.org>
> ---
>  arch/arm/mach-omap2/pmic-cpcap.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-omap2/pmic-cpcap.c b/arch/arm/mach-omap2/pmic-cpcap.c
> index 668dc84fd31e..b9188dde13b9 100644
> --- a/arch/arm/mach-omap2/pmic-cpcap.c
> +++ b/arch/arm/mach-omap2/pmic-cpcap.c
> @@ -245,7 +245,8 @@ int __init omap4_cpcap_init(void)
>  	voltdm = voltdm_lookup("mpu");
>  	omap_voltage_register_pmic(voltdm, &omap443x_max8952_mpu);
>  
> -	if (of_machine_is_compatible("motorola,droid-bionic")) {
> +	if (of_machine_is_compatible("motorola,droid-bionic") ||
> +	    of_machine_is_compatible("motorola,droid3")) {
>  		voltdm = voltdm_lookup("core");
>  		omap_voltage_register_pmic(voltdm, &omap_cpcap_core);
>  

Looks OK to me, however we should also add all the mapphones to the
Documentation/devicetree/bindings/arm/omap/omap.txt so we can avoid
dtb check warnings. Care to also do a patch for that? Looks like the
others are missing too.

Regards,

Tony



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC PATCH 2/2] Droid3: add initial DTS
  2021-12-12 23:04 ` [RFC PATCH 2/2] Droid3: add initial DTS Merlijn Wajer
@ 2021-12-13  6:01   ` Tony Lindgren
  2021-12-14 21:30     ` Merlijn Wajer
  2021-12-19 13:17   ` Pavel Machek
  1 sibling, 1 reply; 8+ messages in thread
From: Tony Lindgren @ 2021-12-13  6:01 UTC (permalink / raw)
  To: Merlijn Wajer
  Cc: Ivaylo Dimitrov, Dev Null, Sebastian Reichel, linux-omap,
	Arnd Bergmann, Olof Johansson, soc, Rob Herring,
	Benoît Cousson, Kees Cook, Anton Vorontsov, Colin Cross,
	Tony Luck, linux-arm-kernel, devicetree, linux-kernel

* Merlijn Wajer <merlijn@wizzup.org> [211212 23:00]:
> @@ -35,7 +35,7 @@ reserved-memory {
>  		 * first 512K of that and just overwrite the rest and configure
>  		 * only 384K instead of 2M.
>  		 */
> -		ramoops@a0080000 {
> +		ramoops0: ramoops@a0080000 {
>  			compatible = "ramoops";
>  			reg = <0xa0080000 0x60000>;
>  			record-size = <0x20000>;

The stock kernel ramoops range might be different here because of less
memory. If the stock kernel has it, it should be in the platform data
somewhere in the stock kernel sources. Probably best to just leave it
out for now.

> +// Do don't know if pstore is supported, but the current config causes panics,
> +// so delete the node for now
> +/delete-node/ &ramoops0;

Just leave this out too, I don't think we have the ramoops configured in
the mainline kernel.

Otherwise looks good to me.

Regards,

Tony

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC PATCH 1/2] pmic-cpcap: add motorola,droid3 compatible
  2021-12-13  5:57   ` Tony Lindgren
@ 2021-12-13 10:37     ` Merlijn Wajer
  2021-12-15  8:42       ` Tony Lindgren
  0 siblings, 1 reply; 8+ messages in thread
From: Merlijn Wajer @ 2021-12-13 10:37 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Ivaylo Dimitrov, Dev Null, Sebastian Reichel, linux-omap,
	Kevin Hilman, Russell King, linux-arm-kernel, linux-kernel

Hi Tony,

On 13/12/2021 06:57, Tony Lindgren wrote:
> * Merlijn Wajer <merlijn@wizzup.org> [211212 23:00]:
>> The Droid 3 and the Bionic appear to share the same hardware, so add
>> the compatible for the Droid 3 as well.
>>
>> Signed-off-by: Merlijn Wajer <merlijn@wizzup.org>
>> ---
>>  arch/arm/mach-omap2/pmic-cpcap.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/mach-omap2/pmic-cpcap.c b/arch/arm/mach-omap2/pmic-cpcap.c
>> index 668dc84fd31e..b9188dde13b9 100644
>> --- a/arch/arm/mach-omap2/pmic-cpcap.c
>> +++ b/arch/arm/mach-omap2/pmic-cpcap.c
>> @@ -245,7 +245,8 @@ int __init omap4_cpcap_init(void)
>>  	voltdm = voltdm_lookup("mpu");
>>  	omap_voltage_register_pmic(voltdm, &omap443x_max8952_mpu);
>>  
>> -	if (of_machine_is_compatible("motorola,droid-bionic")) {
>> +	if (of_machine_is_compatible("motorola,droid-bionic") ||
>> +	    of_machine_is_compatible("motorola,droid3")) {
>>  		voltdm = voltdm_lookup("core");
>>  		omap_voltage_register_pmic(voltdm, &omap_cpcap_core);
>>  
> 
> Looks OK to me, however we should also add all the mapphones to the
> Documentation/devicetree/bindings/arm/omap/omap.txt so we can avoid
> dtb check warnings. Care to also do a patch for that? Looks like the
> others are missing too.

Sure, I'll do that and add the others too while at it. Shall I add those
to this patch, or make a separate patch?

Regards,
Merlijn

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC PATCH 2/2] Droid3: add initial DTS
  2021-12-13  6:01   ` Tony Lindgren
@ 2021-12-14 21:30     ` Merlijn Wajer
  0 siblings, 0 replies; 8+ messages in thread
From: Merlijn Wajer @ 2021-12-14 21:30 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Ivaylo Dimitrov, Dev Null, Sebastian Reichel, linux-omap,
	Arnd Bergmann, Olof Johansson, soc, Rob Herring,
	Benoît Cousson, Kees Cook, Anton Vorontsov, Colin Cross,
	Tony Luck, linux-arm-kernel, devicetree, linux-kernel

Hi Tony,

On 13/12/2021 07:01, Tony Lindgren wrote:
> * Merlijn Wajer <merlijn@wizzup.org> [211212 23:00]:
>> @@ -35,7 +35,7 @@ reserved-memory {
>>  		 * first 512K of that and just overwrite the rest and configure
>>  		 * only 384K instead of 2M.
>>  		 */
>> -		ramoops@a0080000 {
>> +		ramoops0: ramoops@a0080000 {
>>  			compatible = "ramoops";
>>  			reg = <0xa0080000 0x60000>;
>>  			record-size = <0x20000>;
> 
> The stock kernel ramoops range might be different here because of less
> memory. If the stock kernel has it, it should be in the platform data
> somewhere in the stock kernel sources. Probably best to just leave it
> out for now.

Understood -- I didn't see it in the stock kernel, so perhaps ramoops is
not available on this device.

>> +// Do don't know if pstore is supported, but the current config causes panics,
>> +// so delete the node for now
>> +/delete-node/ &ramoops0;
> 
> Just leave this out too, I don't think we have the ramoops configured in
> the mainline kernel.

Oops, yeah.

> Otherwise looks good to me.

Thanks for review!

Regards,
Merlijn

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC PATCH 1/2] pmic-cpcap: add motorola,droid3 compatible
  2021-12-13 10:37     ` Merlijn Wajer
@ 2021-12-15  8:42       ` Tony Lindgren
  0 siblings, 0 replies; 8+ messages in thread
From: Tony Lindgren @ 2021-12-15  8:42 UTC (permalink / raw)
  To: Merlijn Wajer
  Cc: Ivaylo Dimitrov, Dev Null, Sebastian Reichel, linux-omap,
	Kevin Hilman, Russell King, linux-arm-kernel, linux-kernel

* Merlijn Wajer <merlijn@wizzup.org> [211213 10:33]:
> On 13/12/2021 06:57, Tony Lindgren wrote:
> > Looks OK to me, however we should also add all the mapphones to the
> > Documentation/devicetree/bindings/arm/omap/omap.txt so we can avoid
> > dtb check warnings. Care to also do a patch for that? Looks like the
> > others are missing too.
> 
> Sure, I'll do that and add the others too while at it. Shall I add those
> to this patch, or make a separate patch?

Please add a separate binding patch and Cc the devicetree mailing list.

Thanks,

Tony

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC PATCH 2/2] Droid3: add initial DTS
  2021-12-12 23:04 ` [RFC PATCH 2/2] Droid3: add initial DTS Merlijn Wajer
  2021-12-13  6:01   ` Tony Lindgren
@ 2021-12-19 13:17   ` Pavel Machek
  1 sibling, 0 replies; 8+ messages in thread
From: Pavel Machek @ 2021-12-19 13:17 UTC (permalink / raw)
  To: Merlijn Wajer
  Cc: Ivaylo Dimitrov, Dev Null, Tony Lindgren, Sebastian Reichel,
	linux-omap, Arnd Bergmann, Olof Johansson, soc, Rob Herring,
	Benoît Cousson, Kees Cook, Anton Vorontsov, Colin Cross,
	Tony Luck, linux-arm-kernel, devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 396 bytes --]

Hi!

> +		backlight_led: led@0 {
...
> +			label = ":backlight";
> +		};

This is same as Droid 4, good.

> +		led@1 {
...
> +			label = ":kbd_backlight";
> +		};
> +	};

This one is new. We should make sure it is same label as on PCs, and
then document it in Documentation/leds/well-known-leds.txt .

Best regards,
								Pavel
-- 
http://www.livejournal.com/~pavelmachek

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-12-19 13:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20211212230459.13579-1-merlijn@wizzup.org>
2021-12-12 23:04 ` [RFC PATCH 1/2] pmic-cpcap: add motorola,droid3 compatible Merlijn Wajer
2021-12-13  5:57   ` Tony Lindgren
2021-12-13 10:37     ` Merlijn Wajer
2021-12-15  8:42       ` Tony Lindgren
2021-12-12 23:04 ` [RFC PATCH 2/2] Droid3: add initial DTS Merlijn Wajer
2021-12-13  6:01   ` Tony Lindgren
2021-12-14 21:30     ` Merlijn Wajer
2021-12-19 13:17   ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).