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

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
......@@ -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 @@ bu21013_tp@5d {
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>;
};
};
};
};
};
};
......@@ -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 @@ tvk_cfg {
};
};
};
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>;
};
};
};
};
};
};
......@@ -18,17 +18,6 @@ memory {
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";
......
......@@ -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 {
......
......@@ -36,6 +36,11 @@ gpio_in_pu: gpio_input_pull_up {
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>;
......
......@@ -382,14 +382,6 @@ static struct pinctrl_map __initdata hrefv60_pinmap[] = {
/* Accelerometer interrupt lines */
DB8500_PIN_HOG("GPIO82_C1", gpio_in_pu), /* ACC_INT1 */
DB8500_PIN_HOG("GPIO83_D3", gpio_in_pu), /* ACC_INT2 */
/*
* Runtime stuff
* Pull up/down of some sensor GPIO pins, for proximity, HAL sensor
* etc.
*/
DB8500_PIN("GPIO217_AH12", gpio_in_pu_slpm_gpio_nopull, "gpio-keys.0"),
DB8500_PIN("GPIO145_C13", gpio_in_pd_slpm_gpio_nopull, "gpio-keys.0"),
DB8500_PIN("GPIO139_C9", gpio_in_pu_slpm_gpio_nopull, "gpio-keys.0"),
};
static struct pinctrl_map __initdata u9500_pinmap[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment