Skip to content

Commit

Permalink
ARM: dts: s5pv210: Add support for GP2A light sensor on Aries
Browse files Browse the repository at this point in the history
Aries boards have a GP2A light/proximity sensor attached over i2c-gpio.
As the chip outputs a current and the board has no current ADC, a
current shunt resistor and a voltage ADC are used.

Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
  • Loading branch information
xc-racer99 authored and krzk committed Jun 15, 2020
1 parent 99bb203 commit 7c558af
Showing 1 changed file with 48 additions and 2 deletions.
50 changes: 48 additions & 2 deletions arch/arm/boot/dts/s5pv210-aries.dtsi
Expand Up @@ -69,6 +69,18 @@
pinctrl-0 = <&touchkey_vdd_ena>;
};

gp2a_vled: regulator-fixed-2 {
compatible = "regulator-fixed";
regulator-name = "VLED";
enable-active-high;
gpio = <&gpj1 4 GPIO_ACTIVE_HIGH>;
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;

pinctrl-names = "default";
pinctrl-0 = <&gp2a_power>;
};

wifi_pwrseq: wifi-pwrseq {
compatible = "mmc-pwrseq-simple";
reset-gpios = <&gpg1 2 GPIO_ACTIVE_LOW>;
Expand Down Expand Up @@ -468,9 +480,21 @@
pinctrl-names = "default";
pinctrl-0 = <&prox_i2c_pins>;

status = "disabled";
light-sensor@44 {
compatible = "sharp,gp2ap002a00f";
reg = <0x44>;
interrupt-parent = <&gph0>;
interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
vdd-supply = <&gp2a_vled>;
vio-supply = <&gp2a_vled>;
io-channels = <&gp2a_shunt>;
io-channel-names = "alsout";
sharp,proximity-far-hysteresis = /bits/ 8 <0x40>;
sharp,proximity-close-hysteresis = /bits/ 8 <0x20>;

/* Sharp gp2a prox/light sensor, incomplete mainline binding */
pinctrl-names = "default";
pinctrl-0 = <&gp2a_irq>;
};
};

i2c_magnetometer: i2c-gpio-7 {
Expand Down Expand Up @@ -543,6 +567,14 @@
vdd-supply = <&ldo4_reg>;

status = "okay";

gp2a_shunt: current-sense-shunt {
compatible = "current-sense-shunt";
io-channels = <&adc 9>;
shunt-resistor-micro-ohms = <47000000>; /* 47 ohms */
#io-channel-cells = <0>;
io-channel-ranges;
};
};

&fimd {
Expand Down Expand Up @@ -618,6 +650,13 @@
samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
};

gp2a_irq: gp2a-irq {
samsung,pins = "gph0-2";
samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
samsung,pin-pud = <S3C64XX_PIN_PULL_DOWN>;
samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
};

pmic_dvs_pins: pmic-dvs-pins {
samsung,pins = "gph0-3", "gph0-4", "gph0-5";
samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
Expand Down Expand Up @@ -686,6 +725,13 @@
samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
};

gp2a_power: gp2a-power {
samsung,pins = "gpj1-4";
samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
};

touchkey_i2c_pins: touchkey-i2c-pins {
samsung,pins = "gpj3-0", "gpj3-1";
samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
Expand Down

0 comments on commit 7c558af

Please sign in to comment.