Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a780d45 authored by Linus Walleij's avatar Linus Walleij
Browse files

ARM: ux500: move GPIO key configuration to device tree



This moves over the configuration of the GPIO keys (used for
proximity sensor and Hall effect sensor) from the static pin
configuration file to the device tree. As part of the exercise,
implement the GPIO keys properly in a per-UIB file as this
setup actually differs with each UIB.

Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 3ae2750a
Loading
Loading
Loading
Loading
+41 −0
Original line number Diff line number Diff line
@@ -12,6 +12,28 @@
#include <dt-bindings/interrupt-controller/irq.h>

/ {
	gpio_keys {
		compatible = "gpio-keys";
		#address-cells = <1>;
		#size-cells = <0>;
		vdd-supply = <&ab8500_ldo_aux1_reg>;
		pinctrl-names = "default";
		pinctrl-0 = <&prox_stuib_mode>, <&hall_stuib_mode>;

		button@139 {
			/* Proximity sensor */
			gpios = <&gpio6 25 0x4>;
			linux,code = <11>; /* SW_FRONT_PROXIMITY */
			label = "SFH7741 Proximity Sensor";
		};
		button@145 {
			/* Hall sensor */
			gpios = <&gpio4 17 0x4>;
			linux,code = <0>; /* SW_LID */
			label = "HED54XXU11 Hall Effect Sensor";
		};
	};

	soc {
		i2c@80004000 {
			stmpe1601: stmpe1601@40 {
@@ -74,5 +96,24 @@
				rohm,flip-y;
			};
		};

		pinctrl {
			prox {
				prox_stuib_mode: prox_stuib {
					stuib_cfg {
						ste,pins = "GPIO217_AH12";
						ste,config = <&gpio_in_pu>;
					};
				};
			};
			hall {
				hall_stuib_mode: stuib_tvk {
					stuib_cfg {
						ste,pins = "GPIO145_C13";
						ste,config = <&gpio_in_pu>;
					};
				};
			};
		};
	};
};
+38 −0
Original line number Diff line number Diff line
@@ -14,6 +14,28 @@
#include <dt-bindings/interrupt-controller/irq.h>

/ {
	gpio_keys {
		compatible = "gpio-keys";
		#address-cells = <1>;
		#size-cells = <0>;
		vdd-supply = <&ab8500_ldo_aux1_reg>;
		pinctrl-names = "default";
		pinctrl-0 = <&prox_tvk_mode>, <&hall_tvk_mode>;

		button@139 {
			/* Proximity sensor */
			gpios = <&gpio6 25 0x4>;
			linux,code = <11>; /* SW_FRONT_PROXIMITY */
			label = "SFH7741 Proximity Sensor";
		};
		button@145 {
			/* Hall sensor */
			gpios = <&gpio4 17 0x4>;
			linux,code = <0>; /* SW_LID */
			label = "HED54XXU11 Hall Effect Sensor";
		};
	};

	soc {
		/* Add Synaptics touch screen, TC35893 keypad etc here */
		i2c@80004000 {
@@ -76,6 +98,22 @@
					};
				};
			};
			prox {
				prox_tvk_mode: prox_tvk {
					tvk_cfg {
						ste,pins = "GPIO217_AH12";
						ste,config = <&gpio_in_pu>;
					};
				};
			};
			hall {
				hall_tvk_mode: hall_tvk {
					tvk_cfg {
						ste,pins = "GPIO145_C13";
						ste,config = <&gpio_in_pu>;
					};
				};
			};
		};
	};
};
+0 −11
Original line number Diff line number Diff line
@@ -18,17 +18,6 @@
		reg = <0x00000000 0x20000000>;
	};

	gpio_keys {
		compatible = "gpio-keys";
		#address-cells = <1>;
		#size-cells = <0>;

		button@1 {
			linux,code = <11>;
			label = "SFH7741 Proximity Sensor";
		};
	};

	soc {
		usb_per5@a03e0000 {
			pinctrl-names = "default", "sleep";
+0 −6
Original line number Diff line number Diff line
@@ -16,12 +16,6 @@
	model = "ST-Ericsson HREF (v60+) platform with Device Tree";
	compatible = "st-ericsson,hrefv60+", "st-ericsson,u8500";

	gpio_keys {
		button@1 {
			gpios = <&gpio5 25 0x4>;
		};
	};

	soc {
		// External Micro SD slot
		sdi0_per1@80126000 {
+5 −0
Original line number Diff line number Diff line
@@ -36,6 +36,11 @@
		ste,input = <INPUT_PULLUP>;
	};

	gpio_in_pd: gpio_input_pull_down {
		ste,gpio = <GPIOMODE_ENABLED>;
		ste,input = <INPUT_PULLDOWN>;
	};

	gpio_out_lo: gpio_output_low {
		ste,gpio = <GPIOMODE_ENABLED>;
		ste,output = <OUTPUT_LOW>;
Loading