diff mbox

[1/5] arm: dts: omap3-gta04: Add missing nodes to fully describe gta04 board

Message ID 1405369228-27197-2-git-send-email-marek@goldelico.com (mailing list archive)
State New, archived
Headers show

Commit Message

Marek Belisko July 14, 2014, 8:20 p.m. UTC
Signed-off-by: Marek Belisko <marek@goldelico.com>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
 arch/arm/boot/dts/omap3-gta04.dts | 443 +++++++++++++++++++++++++++++++++++---
 1 file changed, 412 insertions(+), 31 deletions(-)

Comments

Joachim Eastwood July 15, 2014, 12:45 p.m. UTC | #1
Hi Marek,

You seem to add some DT nodes for hw that doesn't have drivers in
mainline. I think you should leave those out until the driver itself
is upstream and the bindings for it is documented.

On 14 July 2014 22:20, Marek Belisko <marek@goldelico.com> wrote:
> Signed-off-by: Marek Belisko <marek@goldelico.com>
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> ---
>  arch/arm/boot/dts/omap3-gta04.dts | 443 +++++++++++++++++++++++++++++++++++---
>  1 file changed, 412 insertions(+), 31 deletions(-)
>
> diff --git a/arch/arm/boot/dts/omap3-gta04.dts b/arch/arm/boot/dts/omap3-gta04.dts
> index 215513b..bd6a71d 100644
> --- a/arch/arm/boot/dts/omap3-gta04.dts
> +++ b/arch/arm/boot/dts/omap3-gta04.dts
> @@ -12,7 +12,7 @@
>  #include "omap36xx.dtsi"
>
>  / {
> -       model = "OMAP3 GTA04";
> +       model = "Goldelico GTA04";
>         compatible = "ti,omap3-gta04", "ti,omap36xx", "ti,omap3";
>
>         cpus {
> @@ -26,6 +26,11 @@
>                 reg = <0x80000000 0x20000000>; /* 512 MB */
>         };
>
> +       aliases {
> +               display0 = &lcd;
> +               display1 = &tv0;
> +       };
> +
>         gpio-keys {
>                 compatible = "gpio-keys";
>
> @@ -37,15 +42,78 @@
>                 };
>         };
>
> +       gpio-keys-wwan-wakeup {
> +               compatible = "gpio-keys";
> +
> +               wwan_wakeup_button: wwan-wakeup-button {
> +                       label = "3G_WOE";
> +                       linux,code = <240>;
> +                       gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
> +                       gpio-key,wakeup;
> +               };
> +       };
> +
> +       hsusb2_phy: hsusb2_phy {
> +               compatible = "usb-nop-xceiv";
> +               reset-gpios = <&gpio6 14 GPIO_ACTIVE_LOW>; /* gpio_174 = reset for USB3322 */
> +       };
> +
> +       antenna-detect {
> +               compatible = "linux,extcon-gpio";
> +               label = "gps_antenna";
> +               gpios = <&gpio5 16 0>; /* gpio_144 */
> +               debounce-delay-ms = <10>;
> +               irq-flags = <IRQ_TYPE_EDGE_BOTH>;
> +               state-on = "external";
> +               state-off = "internal";
> +       };
> +
>         sound {
>                 compatible = "ti,omap-twl4030";
>                 ti,model = "gta04";
>
>                 ti,mcbsp = <&mcbsp2>;
>                 ti,codec = <&twl_audio>;
> +
> +               ti,mcbsp-voice = <&mcbsp4>;
> +       };
> +
> +       sound_card {
> +               compatible = "goldelico,gta04-audio";
> +               gta04,cpu-dai = <&mcbsp2>;
> +       };
> +
> +       gtm601_codec: voice_codec {
> +               compatible = "gtm601-codec";
> +       };
> +
> +       sound_voice {
> +               compatible = "goldelico,gta04-voice";
> +               gta04,cpu-dai = <&mcbsp4>;
> +               gta04,codec = <&gtm601_codec>;
>         };
>
> -       spi_lcd {
> +       w2cbw003_codec: headset_codec {
> +               compatible = "w2cbw003-codec";
> +       };
> +
> +       sound_headset {
> +               compatible = "goldelico,gta04-headset";
> +               gta04,cpu-dai = <&mcbsp3>;
> +               gta04,codec = <&w2cbw003_codec>;
> +       };
> +
> +       sound_fm {
> +               compatible = "goldelico,gta04-fm";
> +               gta04,cpu-dai = <&mcbsp1>;
> +               gta04,codec = <&si4721_codec>;
> +       };
> +
> +       madc-hwmon {
> +               compatible = "ti,twl4030-madc-hwmon";
> +       };
> +
> +       spi_lcd: spi_lcd {
>                 compatible = "spi-gpio";
>                 #address-cells = <0x1>;
>                 #size-cells = <0x0>;
> @@ -75,7 +143,7 @@
>                 };
>         };
>
> -       battery {
> +       madc_battery: battery {
>                 compatible = "ti,twl4030-madc-battery";
>                 capacity = <1200000>;
>                 charging-calibration-data = <4200 100
> @@ -100,6 +168,83 @@
>                                    "ichg",
>                                    "vbat";
>         };
> +
> +       backlight {
> +               compatible = "pwm-backlight";
> +               pwms = <&pwm 0 2000000>;
> +               brightness-levels = <0 11 20 30 40 50 60 70 80 90 100>;
> +               default-brightness-level = <10>;
> +               pinctrl-names = "default";
> +               pintcrl-0 = <&backlight_pins>;
> +               power-supply = <&power>;
> +       };
> +
> +       pwm: omap_pwm {
> +               compatible = "ti,omap-pwm";
> +               timers = <&timer11>;
> +               #pwm-cells = <2>;
> +       };

The omap-pwm driver is not yet upstream and thus the bindings are not final.

> +       /* should be a PWM */
> +       power: fixed_regulator@0 {
> +              compatible = "regulator-fixed";
> +              regulator-name = "bl-enable";
> +              regulator-boot-on;
> +              regulator-always-on;
> +              regulator-min-microvolt = "1000000";
> +              regulator-max-microvolt = "1000000";
> +              gpio = <&gpio2 25 0>;    /* GPT11/PWM */
> +              enable-active-high;
> +       };
> +
> +       tv0: connector@1 {
> +               compatible = "svideo-connector";
> +               label = "tv";
> +
> +               port {
> +                       tv_connector_in: endpoint {
> +                               remote-endpoint = <&venc_out>;
> +                       };
> +               };
> +       };
> +
> +       tv_amp: opa362 {
> +               compatible = "ti,opa362";
> +               gpio = <&gpio1 23 0>;   /* GPIO to enable video out amplifier */
> +       };

Driver for a OPAMP?

> +       /* presents a single gpio to be plumbed to uart1 dts */
> +       bt_en: w2cbw003 {
> +               compatible = "wi2wi,w2cbw003";
> +               gpio-controller;
> +               #gpio-cells = <2>;
> +
> +               vdd-supply = <&vaux4>;
> +       };
> +
> +       /* presents a single gpio to be plumbed to uart2 dts */
> +       gps_en: w2sg0004 {
> +               compatible = "wi2wi,w2sg0004";
> +               gpio-controller;
> +               #gpio-cells = <2>;
> +
> +               lna-supply = <&vsim>;   /* LNA regulator */
> +               on-off-gpio = <&gpio5 17 0>;    /* gpio_145: trigger for turning on/off w2sg0004 */
> +               rx-gpio = <&gpio5 19 0>;        /* gpio_147: RX */
> +               rx-on-mux = < (PIN_INPUT_PULLUP | MUX_MODE0) >;
> +               rx-off-mux = < (PIN_INPUT_PULLUP | MUX_MODE4) >;
> +       };
> +
> +       /* control modem power through rfkill */
> +       modem_en: modem {
> +               compatible = "option,gtm601";
> +               gpio-controller;
> +               #gpio-cells = <2>;
> +
> +               usb-port = <&hsusb2_phy>;
> +               on-off-gpio = <&gpio6 26 0>;    /* gpio_186: trigger to power on modem */
> +               on-indicator-gpio = <0>;
> +       };
>  };

I don't think any of the above devices have documented bindings so I
don't think it is a good idea to add the nodes now.

>  &omap3_pmx_core {
> @@ -168,11 +313,72 @@
>                 >;
>         };
>
> +       backlight_pins: backlight_pins_pimnux {
> +               pinctrl-single,pins = <0x8a MUX_MODE4>;
> +       };
> +
> +       hsusb2_pins: pinmux_hsusb2_pins {
> +               pinctrl-single,pins = <
> +                       OMAP3_CORE1_IOPAD(0x21d4, PIN_INPUT_PULLDOWN | MUX_MODE3)       /* mcspi1_cs3.hsusb2_data2 */
> +                       OMAP3_CORE1_IOPAD(0x21d6, PIN_INPUT_PULLDOWN | MUX_MODE3)       /* mcspi2_clk.hsusb2_data7 */
> +                       OMAP3_CORE1_IOPAD(0x21d8, PIN_INPUT_PULLDOWN | MUX_MODE3)       /* mcspi2_simo.hsusb2_data4 */
> +                       OMAP3_CORE1_IOPAD(0x21da, PIN_INPUT_PULLDOWN | MUX_MODE3)       /* mcspi2_somi.hsusb2_data5 */
> +                       OMAP3_CORE1_IOPAD(0x21dc, PIN_INPUT_PULLDOWN | MUX_MODE3)       /* mcspi2_cs0.hsusb2_data6 */
> +                       OMAP3_CORE1_IOPAD(0x21de, PIN_INPUT_PULLDOWN | MUX_MODE3)       /* mcspi2_cs1.hsusb2_data3 */
> +               >;
> +       };
> +
> +       i2c1_pins: pinmux_i2c1_pins {
> +               pinctrl-single,pins = <
> +                       0x18a (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c1_scl.i2c1_scl */
> +                       0x18c (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c1_sda.i2c1_sda */
> +               >;
> +       };
> +
> +       i2c2_pins: pinmux_i2c2_pins {
> +               pinctrl-single,pins = <
> +                       0x18e (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c2_scl.i2c2_scl */
> +                       0x190 (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c2_sda.i2c2_sda */
> +               >;
> +       };
> +
> +       i2c3_pins: pinmux_i2c3_pins {
> +               pinctrl-single,pins = <
> +                       0x192 (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c3_scl.i2c3_scl */
> +                       0x194 (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c3_sda.i2c3_sda */
> +               >;
> +       };

Any reason why you don't use OMAP_IOPAD macro for the I2C pins?

> +
> +       bma180_pins: pinmux_bma180_pins {
> +               pinctrl-single,pins = <
> +                       OMAP3_CORE1_IOPAD(0x213a, PIN_INPUT_PULLUP | MUX_MODE4)   /* gpio_115 */
> +               >;
> +       };
> +};
> +
> +&omap3_pmx_core2 {
> +       pinctrl-names = "default";
> +       pinctrl-0 = <
> +                       &hsusb2_2_pins
> +       >;
> +
> +       hsusb2_2_pins: pinmux_hsusb2_2_pins {
> +               pinctrl-single,pins = <
> +                       OMAP3630_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3)            /* etk_d10.hsusb2_clk */
> +                       OMAP3630_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3)            /* etk_d11.hsusb2_stp */
> +                       OMAP3630_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3)    /* etk_d12.hsusb2_dir */
> +                       OMAP3630_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3)    /* etk_d13.hsusb2_nxt */
> +                       OMAP3630_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3)    /* etk_d14.hsusb2_data0 */
> +                       OMAP3630_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3)    /* etk_d15.hsusb2_data1 */
> +               >;
> +       };
> +
>         spi_gpio_pins: spi_gpio_pinmux {
> -               pinctrl-single,pins = <0x5a8 (PIN_OUTPUT | MUX_MODE4) /* clk */
> -                       0x5b6 (PIN_OUTPUT | MUX_MODE4) /* cs */
> -                       0x5b8 (PIN_OUTPUT | MUX_MODE4) /* tx */
> -                       0x5b4 (PIN_INPUT | MUX_MODE4) /* rx */
> +               pinctrl-single,pins = <
> +                       OMAP3630_CORE2_IOPAD(0x25d8, PIN_OUTPUT | MUX_MODE4) /* clk */
> +                       OMAP3630_CORE2_IOPAD(0x25e6, PIN_OUTPUT | MUX_MODE4) /* cs */
> +                       OMAP3630_CORE2_IOPAD(0x25e8, PIN_OUTPUT | MUX_MODE4) /* tx */
> +                       OMAP3630_CORE2_IOPAD(0x25e4, PIN_INPUT | MUX_MODE4) /* rx */
>                 >;
>         };
>  };

regards,
Joachim Eastwood
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
H. Nikolaus Schaller July 16, 2014, 7:17 a.m. UTC | #2
Hi Joachim,
is there some policy for only having nodes for existing drivers in DT files?

If I understand the device tree concept correctly, it should not describe drivers
(and hence nothing about the state of them being mainlined), but it should statically
describe the given hardware in a way that kernel and drivers can read it (or ignore).
And even other kernels can use it (because they run on the same hardware).

So unless there is an important reason not to have "currently unused" nodes
in the DT source/binary (loading time is IMHO neglectable), I would ask that we
can keep with the complete DT instead of splitting it up artificially and getting back
to the same status (because the hardware does not change over time).

Regarding bindings documentation I agree that it is a very necessary part of
each driver, i.e. documenting what the driver supports.

BR,
Nikolaus


Am 15.07.2014 um 14:45 schrieb Joachim Eastwood:

> Hi Marek,
> 
> You seem to add some DT nodes for hw that doesn't have drivers in
> mainline. I think you should leave those out until the driver itself
> is upstream and the bindings for it is documented.
> 
> On 14 July 2014 22:20, Marek Belisko <marek@goldelico.com> wrote:
>> Signed-off-by: Marek Belisko <marek@goldelico.com>
>> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
>> ---
>> arch/arm/boot/dts/omap3-gta04.dts | 443 +++++++++++++++++++++++++++++++++++---
>> 1 file changed, 412 insertions(+), 31 deletions(-)
>> 
>> diff --git a/arch/arm/boot/dts/omap3-gta04.dts b/arch/arm/boot/dts/omap3-gta04.dts
>> index 215513b..bd6a71d 100644
>> --- a/arch/arm/boot/dts/omap3-gta04.dts
>> +++ b/arch/arm/boot/dts/omap3-gta04.dts
>> @@ -12,7 +12,7 @@
>> #include "omap36xx.dtsi"
>> 
>> / {
>> -       model = "OMAP3 GTA04";
>> +       model = "Goldelico GTA04";
>>        compatible = "ti,omap3-gta04", "ti,omap36xx", "ti,omap3";
>> 
>>        cpus {
>> @@ -26,6 +26,11 @@
>>                reg = <0x80000000 0x20000000>; /* 512 MB */
>>        };
>> 
>> +       aliases {
>> +               display0 = &lcd;
>> +               display1 = &tv0;
>> +       };
>> +
>>        gpio-keys {
>>                compatible = "gpio-keys";
>> 
>> @@ -37,15 +42,78 @@
>>                };
>>        };
>> 
>> +       gpio-keys-wwan-wakeup {
>> +               compatible = "gpio-keys";
>> +
>> +               wwan_wakeup_button: wwan-wakeup-button {
>> +                       label = "3G_WOE";
>> +                       linux,code = <240>;
>> +                       gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
>> +                       gpio-key,wakeup;
>> +               };
>> +       };
>> +
>> +       hsusb2_phy: hsusb2_phy {
>> +               compatible = "usb-nop-xceiv";
>> +               reset-gpios = <&gpio6 14 GPIO_ACTIVE_LOW>; /* gpio_174 = reset for USB3322 */
>> +       };
>> +
>> +       antenna-detect {
>> +               compatible = "linux,extcon-gpio";
>> +               label = "gps_antenna";
>> +               gpios = <&gpio5 16 0>; /* gpio_144 */
>> +               debounce-delay-ms = <10>;
>> +               irq-flags = <IRQ_TYPE_EDGE_BOTH>;
>> +               state-on = "external";
>> +               state-off = "internal";
>> +       };
>> +
>>        sound {
>>                compatible = "ti,omap-twl4030";
>>                ti,model = "gta04";
>> 
>>                ti,mcbsp = <&mcbsp2>;
>>                ti,codec = <&twl_audio>;
>> +
>> +               ti,mcbsp-voice = <&mcbsp4>;
>> +       };
>> +
>> +       sound_card {
>> +               compatible = "goldelico,gta04-audio";
>> +               gta04,cpu-dai = <&mcbsp2>;
>> +       };
>> +
>> +       gtm601_codec: voice_codec {
>> +               compatible = "gtm601-codec";
>> +       };
>> +
>> +       sound_voice {
>> +               compatible = "goldelico,gta04-voice";
>> +               gta04,cpu-dai = <&mcbsp4>;
>> +               gta04,codec = <&gtm601_codec>;
>>        };
>> 
>> -       spi_lcd {
>> +       w2cbw003_codec: headset_codec {
>> +               compatible = "w2cbw003-codec";
>> +       };
>> +
>> +       sound_headset {
>> +               compatible = "goldelico,gta04-headset";
>> +               gta04,cpu-dai = <&mcbsp3>;
>> +               gta04,codec = <&w2cbw003_codec>;
>> +       };
>> +
>> +       sound_fm {
>> +               compatible = "goldelico,gta04-fm";
>> +               gta04,cpu-dai = <&mcbsp1>;
>> +               gta04,codec = <&si4721_codec>;
>> +       };
>> +
>> +       madc-hwmon {
>> +               compatible = "ti,twl4030-madc-hwmon";
>> +       };
>> +
>> +       spi_lcd: spi_lcd {
>>                compatible = "spi-gpio";
>>                #address-cells = <0x1>;
>>                #size-cells = <0x0>;
>> @@ -75,7 +143,7 @@
>>                };
>>        };
>> 
>> -       battery {
>> +       madc_battery: battery {
>>                compatible = "ti,twl4030-madc-battery";
>>                capacity = <1200000>;
>>                charging-calibration-data = <4200 100
>> @@ -100,6 +168,83 @@
>>                                   "ichg",
>>                                   "vbat";
>>        };
>> +
>> +       backlight {
>> +               compatible = "pwm-backlight";
>> +               pwms = <&pwm 0 2000000>;
>> +               brightness-levels = <0 11 20 30 40 50 60 70 80 90 100>;
>> +               default-brightness-level = <10>;
>> +               pinctrl-names = "default";
>> +               pintcrl-0 = <&backlight_pins>;
>> +               power-supply = <&power>;
>> +       };
>> +
>> +       pwm: omap_pwm {
>> +               compatible = "ti,omap-pwm";
>> +               timers = <&timer11>;
>> +               #pwm-cells = <2>;
>> +       };
> 
> The omap-pwm driver is not yet upstream and thus the bindings are not final.
> 
>> +       /* should be a PWM */
>> +       power: fixed_regulator@0 {
>> +              compatible = "regulator-fixed";
>> +              regulator-name = "bl-enable";
>> +              regulator-boot-on;
>> +              regulator-always-on;
>> +              regulator-min-microvolt = "1000000";
>> +              regulator-max-microvolt = "1000000";
>> +              gpio = <&gpio2 25 0>;    /* GPT11/PWM */
>> +              enable-active-high;
>> +       };
>> +
>> +       tv0: connector@1 {
>> +               compatible = "svideo-connector";
>> +               label = "tv";
>> +
>> +               port {
>> +                       tv_connector_in: endpoint {
>> +                               remote-endpoint = <&venc_out>;
>> +                       };
>> +               };
>> +       };
>> +
>> +       tv_amp: opa362 {
>> +               compatible = "ti,opa362";
>> +               gpio = <&gpio1 23 0>;   /* GPIO to enable video out amplifier */
>> +       };
> 
> Driver for a OPAMP?
> 
>> +       /* presents a single gpio to be plumbed to uart1 dts */
>> +       bt_en: w2cbw003 {
>> +               compatible = "wi2wi,w2cbw003";
>> +               gpio-controller;
>> +               #gpio-cells = <2>;
>> +
>> +               vdd-supply = <&vaux4>;
>> +       };
>> +
>> +       /* presents a single gpio to be plumbed to uart2 dts */
>> +       gps_en: w2sg0004 {
>> +               compatible = "wi2wi,w2sg0004";
>> +               gpio-controller;
>> +               #gpio-cells = <2>;
>> +
>> +               lna-supply = <&vsim>;   /* LNA regulator */
>> +               on-off-gpio = <&gpio5 17 0>;    /* gpio_145: trigger for turning on/off w2sg0004 */
>> +               rx-gpio = <&gpio5 19 0>;        /* gpio_147: RX */
>> +               rx-on-mux = < (PIN_INPUT_PULLUP | MUX_MODE0) >;
>> +               rx-off-mux = < (PIN_INPUT_PULLUP | MUX_MODE4) >;
>> +       };
>> +
>> +       /* control modem power through rfkill */
>> +       modem_en: modem {
>> +               compatible = "option,gtm601";
>> +               gpio-controller;
>> +               #gpio-cells = <2>;
>> +
>> +               usb-port = <&hsusb2_phy>;
>> +               on-off-gpio = <&gpio6 26 0>;    /* gpio_186: trigger to power on modem */
>> +               on-indicator-gpio = <0>;
>> +       };
>> };
> 
> I don't think any of the above devices have documented bindings so I
> don't think it is a good idea to add the nodes now.
> 
>> &omap3_pmx_core {
>> @@ -168,11 +313,72 @@
>>> ;
>>        };
>> 
>> +       backlight_pins: backlight_pins_pimnux {
>> +               pinctrl-single,pins = <0x8a MUX_MODE4>;
>> +       };
>> +
>> +       hsusb2_pins: pinmux_hsusb2_pins {
>> +               pinctrl-single,pins = <
>> +                       OMAP3_CORE1_IOPAD(0x21d4, PIN_INPUT_PULLDOWN | MUX_MODE3)       /* mcspi1_cs3.hsusb2_data2 */
>> +                       OMAP3_CORE1_IOPAD(0x21d6, PIN_INPUT_PULLDOWN | MUX_MODE3)       /* mcspi2_clk.hsusb2_data7 */
>> +                       OMAP3_CORE1_IOPAD(0x21d8, PIN_INPUT_PULLDOWN | MUX_MODE3)       /* mcspi2_simo.hsusb2_data4 */
>> +                       OMAP3_CORE1_IOPAD(0x21da, PIN_INPUT_PULLDOWN | MUX_MODE3)       /* mcspi2_somi.hsusb2_data5 */
>> +                       OMAP3_CORE1_IOPAD(0x21dc, PIN_INPUT_PULLDOWN | MUX_MODE3)       /* mcspi2_cs0.hsusb2_data6 */
>> +                       OMAP3_CORE1_IOPAD(0x21de, PIN_INPUT_PULLDOWN | MUX_MODE3)       /* mcspi2_cs1.hsusb2_data3 */
>> +               >;
>> +       };
>> +
>> +       i2c1_pins: pinmux_i2c1_pins {
>> +               pinctrl-single,pins = <
>> +                       0x18a (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c1_scl.i2c1_scl */
>> +                       0x18c (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c1_sda.i2c1_sda */
>> +               >;
>> +       };
>> +
>> +       i2c2_pins: pinmux_i2c2_pins {
>> +               pinctrl-single,pins = <
>> +                       0x18e (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c2_scl.i2c2_scl */
>> +                       0x190 (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c2_sda.i2c2_sda */
>> +               >;
>> +       };
>> +
>> +       i2c3_pins: pinmux_i2c3_pins {
>> +               pinctrl-single,pins = <
>> +                       0x192 (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c3_scl.i2c3_scl */
>> +                       0x194 (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c3_sda.i2c3_sda */
>> +               >;
>> +       };
> 
> Any reason why you don't use OMAP_IOPAD macro for the I2C pins?
> 
>> +
>> +       bma180_pins: pinmux_bma180_pins {
>> +               pinctrl-single,pins = <
>> +                       OMAP3_CORE1_IOPAD(0x213a, PIN_INPUT_PULLUP | MUX_MODE4)   /* gpio_115 */
>> +               >;
>> +       };
>> +};
>> +
>> +&omap3_pmx_core2 {
>> +       pinctrl-names = "default";
>> +       pinctrl-0 = <
>> +                       &hsusb2_2_pins
>> +       >;
>> +
>> +       hsusb2_2_pins: pinmux_hsusb2_2_pins {
>> +               pinctrl-single,pins = <
>> +                       OMAP3630_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3)            /* etk_d10.hsusb2_clk */
>> +                       OMAP3630_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3)            /* etk_d11.hsusb2_stp */
>> +                       OMAP3630_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3)    /* etk_d12.hsusb2_dir */
>> +                       OMAP3630_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3)    /* etk_d13.hsusb2_nxt */
>> +                       OMAP3630_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3)    /* etk_d14.hsusb2_data0 */
>> +                       OMAP3630_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3)    /* etk_d15.hsusb2_data1 */
>> +               >;
>> +       };
>> +
>>        spi_gpio_pins: spi_gpio_pinmux {
>> -               pinctrl-single,pins = <0x5a8 (PIN_OUTPUT | MUX_MODE4) /* clk */
>> -                       0x5b6 (PIN_OUTPUT | MUX_MODE4) /* cs */
>> -                       0x5b8 (PIN_OUTPUT | MUX_MODE4) /* tx */
>> -                       0x5b4 (PIN_INPUT | MUX_MODE4) /* rx */
>> +               pinctrl-single,pins = <
>> +                       OMAP3630_CORE2_IOPAD(0x25d8, PIN_OUTPUT | MUX_MODE4) /* clk */
>> +                       OMAP3630_CORE2_IOPAD(0x25e6, PIN_OUTPUT | MUX_MODE4) /* cs */
>> +                       OMAP3630_CORE2_IOPAD(0x25e8, PIN_OUTPUT | MUX_MODE4) /* tx */
>> +                       OMAP3630_CORE2_IOPAD(0x25e4, PIN_INPUT | MUX_MODE4) /* rx */
>>> ;
>>        };
>> };
> 
> regards,
> Joachim Eastwood

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Joachim Eastwood July 18, 2014, 6:55 a.m. UTC | #3
On 16 July 2014 09:17, Dr. H. Nikolaus Schaller <hns@goldelico.com> wrote:
> Am 15.07.2014 um 14:45 schrieb Joachim Eastwood:
>
>> Hi Marek,
>>
>> You seem to add some DT nodes for hw that doesn't have drivers in
>> mainline. I think you should leave those out until the driver itself
>> is upstream and the bindings for it is documented.
> is there some policy for only having nodes for existing drivers in DT files?

I am not sure about that, better ask the DT maintainers.

There is however a policy that says new bindings should be reviewed
and documented.

> If I understand the device tree concept correctly, it should not describe drivers
> (and hence nothing about the state of them being mainlined), but it should statically
> describe the given hardware in a way that kernel and drivers can read it (or ignore).
> And even other kernels can use it (because they run on the same hardware).
>
> So unless there is an important reason not to have "currently unused" nodes
> in the DT source/binary (loading time is IMHO neglectable), I would ask that we
> can keep with the complete DT instead of splitting it up artificially and getting back
> to the same status (because the hardware does not change over time).

The problem with the nodes is that the bindings may change when the
drivers/bindings are submitted to mainline and reviewed. I don't see
why you want nodes for hardware that right now obviously don't work
with mainline and if the bindings change it will churn and confusion
for the users.

One example is the omap-pwm driver. It should really have #pwm-cells
set to 3 and not 2. This driver is not upstream yet, because it
requires some files to move out of arch/arm. See
http://marc.info/?l=linux-omap&m=139903867022779&w=2 for the suggested
new bindings.

The normal case for new DT boards is to first submit nodes for the
hardware that is working in mainline and then update the DT with more
nodes for hardware as bindings are decided upon and drivers go
upstream.

Please don't top post.

regards,
Joachim Eastwood

>> On 14 July 2014 22:20, Marek Belisko <marek@goldelico.com> wrote:
>>> Signed-off-by: Marek Belisko <marek@goldelico.com>
>>> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
>>> ---
>>> arch/arm/boot/dts/omap3-gta04.dts | 443 +++++++++++++++++++++++++++++++++++---
>>> 1 file changed, 412 insertions(+), 31 deletions(-)
>>>
>>> diff --git a/arch/arm/boot/dts/omap3-gta04.dts b/arch/arm/boot/dts/omap3-gta04.dts
>>> index 215513b..bd6a71d 100644
>>> --- a/arch/arm/boot/dts/omap3-gta04.dts
>>> +++ b/arch/arm/boot/dts/omap3-gta04.dts
>>> @@ -12,7 +12,7 @@
>>> #include "omap36xx.dtsi"
>>>
>>> / {
>>> -       model = "OMAP3 GTA04";
>>> +       model = "Goldelico GTA04";
>>>        compatible = "ti,omap3-gta04", "ti,omap36xx", "ti,omap3";
>>>
>>>        cpus {
>>> @@ -26,6 +26,11 @@
>>>                reg = <0x80000000 0x20000000>; /* 512 MB */
>>>        };
>>>
>>> +       aliases {
>>> +               display0 = &lcd;
>>> +               display1 = &tv0;
>>> +       };
>>> +
>>>        gpio-keys {
>>>                compatible = "gpio-keys";
>>>
>>> @@ -37,15 +42,78 @@
>>>                };
>>>        };
>>>
>>> +       gpio-keys-wwan-wakeup {
>>> +               compatible = "gpio-keys";
>>> +
>>> +               wwan_wakeup_button: wwan-wakeup-button {
>>> +                       label = "3G_WOE";
>>> +                       linux,code = <240>;
>>> +                       gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
>>> +                       gpio-key,wakeup;
>>> +               };
>>> +       };
>>> +
>>> +       hsusb2_phy: hsusb2_phy {
>>> +               compatible = "usb-nop-xceiv";
>>> +               reset-gpios = <&gpio6 14 GPIO_ACTIVE_LOW>; /* gpio_174 = reset for USB3322 */
>>> +       };
>>> +
>>> +       antenna-detect {
>>> +               compatible = "linux,extcon-gpio";
>>> +               label = "gps_antenna";
>>> +               gpios = <&gpio5 16 0>; /* gpio_144 */
>>> +               debounce-delay-ms = <10>;
>>> +               irq-flags = <IRQ_TYPE_EDGE_BOTH>;
>>> +               state-on = "external";
>>> +               state-off = "internal";
>>> +       };
>>> +
>>>        sound {
>>>                compatible = "ti,omap-twl4030";
>>>                ti,model = "gta04";
>>>
>>>                ti,mcbsp = <&mcbsp2>;
>>>                ti,codec = <&twl_audio>;
>>> +
>>> +               ti,mcbsp-voice = <&mcbsp4>;
>>> +       };
>>> +
>>> +       sound_card {
>>> +               compatible = "goldelico,gta04-audio";
>>> +               gta04,cpu-dai = <&mcbsp2>;
>>> +       };
>>> +
>>> +       gtm601_codec: voice_codec {
>>> +               compatible = "gtm601-codec";
>>> +       };
>>> +
>>> +       sound_voice {
>>> +               compatible = "goldelico,gta04-voice";
>>> +               gta04,cpu-dai = <&mcbsp4>;
>>> +               gta04,codec = <&gtm601_codec>;
>>>        };
>>>
>>> -       spi_lcd {
>>> +       w2cbw003_codec: headset_codec {
>>> +               compatible = "w2cbw003-codec";
>>> +       };
>>> +
>>> +       sound_headset {
>>> +               compatible = "goldelico,gta04-headset";
>>> +               gta04,cpu-dai = <&mcbsp3>;
>>> +               gta04,codec = <&w2cbw003_codec>;
>>> +       };
>>> +
>>> +       sound_fm {
>>> +               compatible = "goldelico,gta04-fm";
>>> +               gta04,cpu-dai = <&mcbsp1>;
>>> +               gta04,codec = <&si4721_codec>;
>>> +       };
>>> +
>>> +       madc-hwmon {
>>> +               compatible = "ti,twl4030-madc-hwmon";
>>> +       };
>>> +
>>> +       spi_lcd: spi_lcd {
>>>                compatible = "spi-gpio";
>>>                #address-cells = <0x1>;
>>>                #size-cells = <0x0>;
>>> @@ -75,7 +143,7 @@
>>>                };
>>>        };
>>>
>>> -       battery {
>>> +       madc_battery: battery {
>>>                compatible = "ti,twl4030-madc-battery";
>>>                capacity = <1200000>;
>>>                charging-calibration-data = <4200 100
>>> @@ -100,6 +168,83 @@
>>>                                   "ichg",
>>>                                   "vbat";
>>>        };
>>> +
>>> +       backlight {
>>> +               compatible = "pwm-backlight";
>>> +               pwms = <&pwm 0 2000000>;
>>> +               brightness-levels = <0 11 20 30 40 50 60 70 80 90 100>;
>>> +               default-brightness-level = <10>;
>>> +               pinctrl-names = "default";
>>> +               pintcrl-0 = <&backlight_pins>;
>>> +               power-supply = <&power>;
>>> +       };
>>> +
>>> +       pwm: omap_pwm {
>>> +               compatible = "ti,omap-pwm";
>>> +               timers = <&timer11>;
>>> +               #pwm-cells = <2>;
>>> +       };
>>
>> The omap-pwm driver is not yet upstream and thus the bindings are not final.
>>
>>> +       /* should be a PWM */
>>> +       power: fixed_regulator@0 {
>>> +              compatible = "regulator-fixed";
>>> +              regulator-name = "bl-enable";
>>> +              regulator-boot-on;
>>> +              regulator-always-on;
>>> +              regulator-min-microvolt = "1000000";
>>> +              regulator-max-microvolt = "1000000";
>>> +              gpio = <&gpio2 25 0>;    /* GPT11/PWM */
>>> +              enable-active-high;
>>> +       };
>>> +
>>> +       tv0: connector@1 {
>>> +               compatible = "svideo-connector";
>>> +               label = "tv";
>>> +
>>> +               port {
>>> +                       tv_connector_in: endpoint {
>>> +                               remote-endpoint = <&venc_out>;
>>> +                       };
>>> +               };
>>> +       };
>>> +
>>> +       tv_amp: opa362 {
>>> +               compatible = "ti,opa362";
>>> +               gpio = <&gpio1 23 0>;   /* GPIO to enable video out amplifier */
>>> +       };
>>
>> Driver for a OPAMP?
>>
>>> +       /* presents a single gpio to be plumbed to uart1 dts */
>>> +       bt_en: w2cbw003 {
>>> +               compatible = "wi2wi,w2cbw003";
>>> +               gpio-controller;
>>> +               #gpio-cells = <2>;
>>> +
>>> +               vdd-supply = <&vaux4>;
>>> +       };
>>> +
>>> +       /* presents a single gpio to be plumbed to uart2 dts */
>>> +       gps_en: w2sg0004 {
>>> +               compatible = "wi2wi,w2sg0004";
>>> +               gpio-controller;
>>> +               #gpio-cells = <2>;
>>> +
>>> +               lna-supply = <&vsim>;   /* LNA regulator */
>>> +               on-off-gpio = <&gpio5 17 0>;    /* gpio_145: trigger for turning on/off w2sg0004 */
>>> +               rx-gpio = <&gpio5 19 0>;        /* gpio_147: RX */
>>> +               rx-on-mux = < (PIN_INPUT_PULLUP | MUX_MODE0) >;
>>> +               rx-off-mux = < (PIN_INPUT_PULLUP | MUX_MODE4) >;
>>> +       };
>>> +
>>> +       /* control modem power through rfkill */
>>> +       modem_en: modem {
>>> +               compatible = "option,gtm601";
>>> +               gpio-controller;
>>> +               #gpio-cells = <2>;
>>> +
>>> +               usb-port = <&hsusb2_phy>;
>>> +               on-off-gpio = <&gpio6 26 0>;    /* gpio_186: trigger to power on modem */
>>> +               on-indicator-gpio = <0>;
>>> +       };
>>> };
>>
>> I don't think any of the above devices have documented bindings so I
>> don't think it is a good idea to add the nodes now.
>>
>>> &omap3_pmx_core {
>>> @@ -168,11 +313,72 @@
>>>> ;
>>>        };
>>>
>>> +       backlight_pins: backlight_pins_pimnux {
>>> +               pinctrl-single,pins = <0x8a MUX_MODE4>;
>>> +       };
>>> +
>>> +       hsusb2_pins: pinmux_hsusb2_pins {
>>> +               pinctrl-single,pins = <
>>> +                       OMAP3_CORE1_IOPAD(0x21d4, PIN_INPUT_PULLDOWN | MUX_MODE3)       /* mcspi1_cs3.hsusb2_data2 */
>>> +                       OMAP3_CORE1_IOPAD(0x21d6, PIN_INPUT_PULLDOWN | MUX_MODE3)       /* mcspi2_clk.hsusb2_data7 */
>>> +                       OMAP3_CORE1_IOPAD(0x21d8, PIN_INPUT_PULLDOWN | MUX_MODE3)       /* mcspi2_simo.hsusb2_data4 */
>>> +                       OMAP3_CORE1_IOPAD(0x21da, PIN_INPUT_PULLDOWN | MUX_MODE3)       /* mcspi2_somi.hsusb2_data5 */
>>> +                       OMAP3_CORE1_IOPAD(0x21dc, PIN_INPUT_PULLDOWN | MUX_MODE3)       /* mcspi2_cs0.hsusb2_data6 */
>>> +                       OMAP3_CORE1_IOPAD(0x21de, PIN_INPUT_PULLDOWN | MUX_MODE3)       /* mcspi2_cs1.hsusb2_data3 */
>>> +               >;
>>> +       };
>>> +
>>> +       i2c1_pins: pinmux_i2c1_pins {
>>> +               pinctrl-single,pins = <
>>> +                       0x18a (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c1_scl.i2c1_scl */
>>> +                       0x18c (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c1_sda.i2c1_sda */
>>> +               >;
>>> +       };
>>> +
>>> +       i2c2_pins: pinmux_i2c2_pins {
>>> +               pinctrl-single,pins = <
>>> +                       0x18e (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c2_scl.i2c2_scl */
>>> +                       0x190 (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c2_sda.i2c2_sda */
>>> +               >;
>>> +       };
>>> +
>>> +       i2c3_pins: pinmux_i2c3_pins {
>>> +               pinctrl-single,pins = <
>>> +                       0x192 (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c3_scl.i2c3_scl */
>>> +                       0x194 (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c3_sda.i2c3_sda */
>>> +               >;
>>> +       };
>>
>> Any reason why you don't use OMAP_IOPAD macro for the I2C pins?
>>
>>> +
>>> +       bma180_pins: pinmux_bma180_pins {
>>> +               pinctrl-single,pins = <
>>> +                       OMAP3_CORE1_IOPAD(0x213a, PIN_INPUT_PULLUP | MUX_MODE4)   /* gpio_115 */
>>> +               >;
>>> +       };
>>> +};
>>> +
>>> +&omap3_pmx_core2 {
>>> +       pinctrl-names = "default";
>>> +       pinctrl-0 = <
>>> +                       &hsusb2_2_pins
>>> +       >;
>>> +
>>> +       hsusb2_2_pins: pinmux_hsusb2_2_pins {
>>> +               pinctrl-single,pins = <
>>> +                       OMAP3630_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3)            /* etk_d10.hsusb2_clk */
>>> +                       OMAP3630_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3)            /* etk_d11.hsusb2_stp */
>>> +                       OMAP3630_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3)    /* etk_d12.hsusb2_dir */
>>> +                       OMAP3630_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3)    /* etk_d13.hsusb2_nxt */
>>> +                       OMAP3630_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3)    /* etk_d14.hsusb2_data0 */
>>> +                       OMAP3630_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3)    /* etk_d15.hsusb2_data1 */
>>> +               >;
>>> +       };
>>> +
>>>        spi_gpio_pins: spi_gpio_pinmux {
>>> -               pinctrl-single,pins = <0x5a8 (PIN_OUTPUT | MUX_MODE4) /* clk */
>>> -                       0x5b6 (PIN_OUTPUT | MUX_MODE4) /* cs */
>>> -                       0x5b8 (PIN_OUTPUT | MUX_MODE4) /* tx */
>>> -                       0x5b4 (PIN_INPUT | MUX_MODE4) /* rx */
>>> +               pinctrl-single,pins = <
>>> +                       OMAP3630_CORE2_IOPAD(0x25d8, PIN_OUTPUT | MUX_MODE4) /* clk */
>>> +                       OMAP3630_CORE2_IOPAD(0x25e6, PIN_OUTPUT | MUX_MODE4) /* cs */
>>> +                       OMAP3630_CORE2_IOPAD(0x25e8, PIN_OUTPUT | MUX_MODE4) /* tx */
>>> +                       OMAP3630_CORE2_IOPAD(0x25e4, PIN_INPUT | MUX_MODE4) /* rx */
>>>> ;
>>>        };
>>> };
>>
>> regards,
>> Joachim Eastwood
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Javier Martinez Canillas July 18, 2014, 9:21 a.m. UTC | #4
Hello Marek and Dr. H. Nikolaus,

On Fri, Jul 18, 2014 at 8:55 AM, Joachim Eastwood <manabian@gmail.com> wrote:
> On 16 July 2014 09:17, Dr. H. Nikolaus Schaller <hns@goldelico.com> wrote:
>> Am 15.07.2014 um 14:45 schrieb Joachim Eastwood:
>>
>>> Hi Marek,
>>>
>>> You seem to add some DT nodes for hw that doesn't have drivers in
>>> mainline. I think you should leave those out until the driver itself
>>> is upstream and the bindings for it is documented.
>> is there some policy for only having nodes for existing drivers in DT files?
>

I strongly agree with Joachim on this regard.

>> If I understand the device tree concept correctly, it should not describe drivers
>> (and hence nothing about the state of them being mainlined), but it should statically
>> describe the given hardware in a way that kernel and drivers can read it (or ignore).
>> And even other kernels can use it (because they run on the same hardware).
>>

Yes, it should describe hardware but that description should be
previously agreed and properly documented as was mentioned before.

>> So unless there is an important reason not to have "currently unused" nodes
>> in the DT source/binary (loading time is IMHO neglectable), I would ask that we
>> can keep with the complete DT instead of splitting it up artificially and getting back
>> to the same status (because the hardware does not change over time).
>

I understand your motivation since it will allow you to not have to
maintain a patch-set for your downstream DTS changes but I would like
to ask you the opposite question. What's the benefit for the kernel
community to keep in a mainline DTS a bunch of device nodes with DT
bindings that have not been neither discussed nor documented?

Developers doing a board bring-up usually use the DTS in mainline as a
reference for their boards and having non-documented/agreed DT binding
on the upstream DTS will only bring confusion and frustration to them
IMHO.

We already have some issues with Device Trees (bindings that broke
backward compatibility, drivers implementing custom DT binding instead
of using standard ones, bindings that don't really reflect the actual
H/W, etc), please don't make this even more complicated to developers.

Thanks a lot and best regards,
Javier
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
H. Nikolaus Schaller July 19, 2014, 9:54 a.m. UTC | #5
Hi all,

Am 18.07.2014 um 11:21 schrieb Javier Martinez Canillas:

> Hello Marek and Dr. H. Nikolaus,
> 
> On Fri, Jul 18, 2014 at 8:55 AM, Joachim Eastwood <manabian@gmail.com> wrote:
>> On 16 July 2014 09:17, Dr. H. Nikolaus Schaller <hns@goldelico.com> wrote:
>>> Am 15.07.2014 um 14:45 schrieb Joachim Eastwood:
>>> 
>>>> Hi Marek,
>>>> 
>>>> You seem to add some DT nodes for hw that doesn't have drivers in
>>>> mainline. I think you should leave those out until the driver itself
>>>> is upstream and the bindings for it is documented.
>>> is there some policy for only having nodes for existing drivers in DT files?
>> 
> 
> I strongly agree with Joachim on this regard.
> 
>>> If I understand the device tree concept correctly, it should not describe drivers
>>> (and hence nothing about the state of them being mainlined), but it should statically
>>> describe the given hardware in a way that kernel and drivers can read it (or ignore).
>>> And even other kernels can use it (because they run on the same hardware).
>>> 
> 
> Yes, it should describe hardware but that description should be
> previously agreed and properly documented as was mentioned before.

Ok, it is a little a hen and egg problem - who should start with the documentation.
The device tree file, more or less describing what the hardware requirements
are. Or the drivers which describe what they support.

And you are right - these two ends must match and that can only be resolved by
discussions and negotiations between both ends.

> 
>>> So unless there is an important reason not to have "currently unused" nodes
>>> in the DT source/binary (loading time is IMHO neglectable), I would ask that we
>>> can keep with the complete DT instead of splitting it up artificially and getting back
>>> to the same status (because the hardware does not change over time).
>> 
> 
> I understand your motivation since it will allow you to not have to
> maintain a patch-set for your downstream DTS changes but I would like
> to ask you the opposite question. What's the benefit for the kernel
> community to keep in a mainline DTS a bunch of device nodes with DT
> bindings that have not been neither discussed nor documented?

Less patches to review individually. Just a single one instead.
But this might be a weak benefit.

> 
> Developers doing a board bring-up usually use the DTS in mainline as a
> reference for their boards and having non-documented/agreed DT binding
> on the upstream DTS will only bring confusion and frustration to them
> IMHO.

Well, my experience (at least for the current status) is that in most times new
boards need new drivers and DT nodes anyways. But this might change.

> 
> We already have some issues with Device Trees (bindings that broke
> backward compatibility, drivers implementing custom DT binding instead
> of using standard ones, bindings that don't really reflect the actual
> H/W, etc), please don't make this even more complicated to developers.

Ok, then I think we will do the way as suggested and only submit DT nodes
for already existing drivers. Or submit new ones bundled with driver and
documentation patches.

Marek will update the patches anyways, so that they apply without errors.

> 
> Thanks a lot and best regards,
> Javier

BR,
Nikolaus

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/boot/dts/omap3-gta04.dts b/arch/arm/boot/dts/omap3-gta04.dts
index 215513b..bd6a71d 100644
--- a/arch/arm/boot/dts/omap3-gta04.dts
+++ b/arch/arm/boot/dts/omap3-gta04.dts
@@ -12,7 +12,7 @@ 
 #include "omap36xx.dtsi"
 
 / {
-	model = "OMAP3 GTA04";
+	model = "Goldelico GTA04";
 	compatible = "ti,omap3-gta04", "ti,omap36xx", "ti,omap3";
 
 	cpus {
@@ -26,6 +26,11 @@ 
 		reg = <0x80000000 0x20000000>; /* 512 MB */
 	};
 
+	aliases {
+		display0 = &lcd;
+		display1 = &tv0;
+	};
+
 	gpio-keys {
 		compatible = "gpio-keys";
 
@@ -37,15 +42,78 @@ 
 		};
 	};
 
+	gpio-keys-wwan-wakeup {
+		compatible = "gpio-keys";
+
+		wwan_wakeup_button: wwan-wakeup-button {
+			label = "3G_WOE";
+			linux,code = <240>;
+			gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
+			gpio-key,wakeup;
+		};
+	};
+
+	hsusb2_phy: hsusb2_phy {
+		compatible = "usb-nop-xceiv";
+		reset-gpios = <&gpio6 14 GPIO_ACTIVE_LOW>; /* gpio_174 = reset for USB3322 */
+	};
+
+	antenna-detect {
+		compatible = "linux,extcon-gpio";
+		label = "gps_antenna";
+		gpios = <&gpio5 16 0>; /* gpio_144 */
+		debounce-delay-ms = <10>;
+		irq-flags = <IRQ_TYPE_EDGE_BOTH>;
+		state-on = "external";
+		state-off = "internal";
+	};
+
 	sound {
 		compatible = "ti,omap-twl4030";
 		ti,model = "gta04";
 
 		ti,mcbsp = <&mcbsp2>;
 		ti,codec = <&twl_audio>;
+
+		ti,mcbsp-voice = <&mcbsp4>;
+	};
+
+	sound_card {
+		compatible = "goldelico,gta04-audio";
+		gta04,cpu-dai = <&mcbsp2>;
+	};
+
+	gtm601_codec: voice_codec {
+		compatible = "gtm601-codec";
+	};
+
+	sound_voice {
+		compatible = "goldelico,gta04-voice";
+		gta04,cpu-dai = <&mcbsp4>;
+		gta04,codec = <&gtm601_codec>;
 	};
 
-	spi_lcd {
+	w2cbw003_codec: headset_codec {
+		compatible = "w2cbw003-codec";
+	};
+
+	sound_headset {
+		compatible = "goldelico,gta04-headset";
+		gta04,cpu-dai = <&mcbsp3>;
+		gta04,codec = <&w2cbw003_codec>;
+	};
+
+	sound_fm {
+		compatible = "goldelico,gta04-fm";
+		gta04,cpu-dai = <&mcbsp1>;
+		gta04,codec = <&si4721_codec>;
+	};
+
+	madc-hwmon {
+		compatible = "ti,twl4030-madc-hwmon";
+	};
+
+	spi_lcd: spi_lcd {
 		compatible = "spi-gpio";
 		#address-cells = <0x1>;
 		#size-cells = <0x0>;
@@ -75,7 +143,7 @@ 
 		};
 	};
 
-	battery {
+	madc_battery: battery {
 		compatible = "ti,twl4030-madc-battery";
 		capacity = <1200000>;
 		charging-calibration-data = <4200 100
@@ -100,6 +168,83 @@ 
 		                   "ichg",
 		                   "vbat";
 	};
+
+	backlight {
+		compatible = "pwm-backlight";
+		pwms = <&pwm 0 2000000>;
+		brightness-levels = <0 11 20 30 40 50 60 70 80 90 100>;
+		default-brightness-level = <10>;
+		pinctrl-names = "default";
+		pintcrl-0 = <&backlight_pins>;
+		power-supply = <&power>;
+	};
+
+	pwm: omap_pwm {
+		compatible = "ti,omap-pwm";
+		timers = <&timer11>;
+		#pwm-cells = <2>;
+	};
+
+	/* should be a PWM */
+	power: fixed_regulator@0 {
+	       compatible = "regulator-fixed";
+	       regulator-name = "bl-enable";
+	       regulator-boot-on;
+	       regulator-always-on;
+	       regulator-min-microvolt = "1000000";
+	       regulator-max-microvolt = "1000000";
+	       gpio = <&gpio2 25 0>;	/* GPT11/PWM */
+	       enable-active-high;
+	};
+
+	tv0: connector@1 {
+		compatible = "svideo-connector";
+		label = "tv";
+
+		port {
+			tv_connector_in: endpoint {
+				remote-endpoint = <&venc_out>;
+			};
+		};
+	};
+
+	tv_amp: opa362 {
+		compatible = "ti,opa362";
+		gpio = <&gpio1 23 0>;	/* GPIO to enable video out amplifier */
+	};
+
+	/* presents a single gpio to be plumbed to uart1 dts */
+	bt_en: w2cbw003 {
+		compatible = "wi2wi,w2cbw003";
+		gpio-controller;
+		#gpio-cells = <2>;
+
+		vdd-supply = <&vaux4>;
+	};
+
+	/* presents a single gpio to be plumbed to uart2 dts */
+	gps_en: w2sg0004 {
+		compatible = "wi2wi,w2sg0004";
+		gpio-controller;
+		#gpio-cells = <2>;
+
+		lna-supply = <&vsim>;	/* LNA regulator */
+		on-off-gpio = <&gpio5 17 0>;	/* gpio_145: trigger for turning on/off w2sg0004 */
+		rx-gpio = <&gpio5 19 0>;	/* gpio_147: RX */
+		rx-on-mux = < (PIN_INPUT_PULLUP | MUX_MODE0) >;
+		rx-off-mux = < (PIN_INPUT_PULLUP | MUX_MODE4) >;
+	};
+
+	/* control modem power through rfkill */
+	modem_en: modem {
+		compatible = "option,gtm601";
+		gpio-controller;
+		#gpio-cells = <2>;
+
+		usb-port = <&hsusb2_phy>;
+		on-off-gpio = <&gpio6 26 0>;	/* gpio_186: trigger to power on modem */
+		on-indicator-gpio = <0>;
+	};
 };
 
 &omap3_pmx_core {
@@ -168,11 +313,72 @@ 
                >;
        };
 
+	backlight_pins: backlight_pins_pimnux {
+		pinctrl-single,pins = <0x8a MUX_MODE4>;
+	};
+
+	hsusb2_pins: pinmux_hsusb2_pins {
+		pinctrl-single,pins = <
+			OMAP3_CORE1_IOPAD(0x21d4, PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi1_cs3.hsusb2_data2 */
+			OMAP3_CORE1_IOPAD(0x21d6, PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_clk.hsusb2_data7 */
+			OMAP3_CORE1_IOPAD(0x21d8, PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_simo.hsusb2_data4 */
+			OMAP3_CORE1_IOPAD(0x21da, PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_somi.hsusb2_data5 */
+			OMAP3_CORE1_IOPAD(0x21dc, PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_cs0.hsusb2_data6 */
+			OMAP3_CORE1_IOPAD(0x21de, PIN_INPUT_PULLDOWN | MUX_MODE3)	/* mcspi2_cs1.hsusb2_data3 */
+		>;
+	};
+
+	i2c1_pins: pinmux_i2c1_pins {
+		pinctrl-single,pins = <
+			0x18a (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c1_scl.i2c1_scl */
+			0x18c (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c1_sda.i2c1_sda */
+		>;
+	};
+
+	i2c2_pins: pinmux_i2c2_pins {
+		pinctrl-single,pins = <
+			0x18e (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c2_scl.i2c2_scl */
+			0x190 (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c2_sda.i2c2_sda */
+		>;
+	};
+
+	i2c3_pins: pinmux_i2c3_pins {
+		pinctrl-single,pins = <
+			0x192 (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c3_scl.i2c3_scl */
+			0x194 (PIN_INPUT_PULLUP | MUX_MODE0)   /* i2c3_sda.i2c3_sda */
+		>;
+	};
+
+	bma180_pins: pinmux_bma180_pins {
+		pinctrl-single,pins = <
+			OMAP3_CORE1_IOPAD(0x213a, PIN_INPUT_PULLUP | MUX_MODE4)   /* gpio_115 */
+		>;
+	};
+};
+
+&omap3_pmx_core2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <
+			&hsusb2_2_pins
+	>;
+
+	hsusb2_2_pins: pinmux_hsusb2_2_pins {
+		pinctrl-single,pins = <
+			OMAP3630_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3)		/* etk_d10.hsusb2_clk */
+			OMAP3630_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3)		/* etk_d11.hsusb2_stp */
+			OMAP3630_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d12.hsusb2_dir */
+			OMAP3630_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d13.hsusb2_nxt */
+			OMAP3630_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d14.hsusb2_data0 */
+			OMAP3630_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3)	/* etk_d15.hsusb2_data1 */
+		>;
+	};
+
 	spi_gpio_pins: spi_gpio_pinmux {
-		pinctrl-single,pins = <0x5a8 (PIN_OUTPUT | MUX_MODE4) /* clk */
-			0x5b6 (PIN_OUTPUT | MUX_MODE4) /* cs */
-			0x5b8 (PIN_OUTPUT | MUX_MODE4) /* tx */
-			0x5b4 (PIN_INPUT | MUX_MODE4) /* rx */
+		pinctrl-single,pins = <
+			OMAP3630_CORE2_IOPAD(0x25d8, PIN_OUTPUT | MUX_MODE4) /* clk */
+			OMAP3630_CORE2_IOPAD(0x25e6, PIN_OUTPUT | MUX_MODE4) /* cs */
+			OMAP3630_CORE2_IOPAD(0x25e8, PIN_OUTPUT | MUX_MODE4) /* tx */
+			OMAP3630_CORE2_IOPAD(0x25e4, PIN_INPUT | MUX_MODE4) /* rx */
 		>;
 	};
 };
@@ -184,11 +390,55 @@ 
 		reg = <0x48>;
 		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
 		interrupt-parent = <&intc>;
-	};
 
-	twl_audio: audio {
-		compatible = "ti,twl4030-audio";
-		codec {
+		twl_power: power {
+			compatible = "ti,twl4030-power";
+			ti,use_poweroff;
+		};
+		/* spare */
+		vaux1: regulator-vaux1 {
+			compatible = "ti,twl4030-vaux1";
+			regulator-min-microvolt = <2500000>;
+			regulator-max-microvolt = <3000000>;
+		};
+		/* sensors */
+		vaux2: regulator-vaux2 {
+			compatible = "ti,twl4030-vaux2";
+			regulator-min-microvolt = <2800000>;
+			regulator-max-microvolt = <2800000>;
+			regulator-always-on;	/* we should not switch off while keeping 1V8 on! */
+		};
+		/* camera */
+		vaux3: regulator-vaux3 {
+			compatible = "ti,twl4030-vaux3";
+			regulator-min-microvolt = <2500000>;
+			regulator-max-microvolt = <2500000>;
+		};
+		/* WLAN/BT */
+		vaux4: regulator-vaux4 {
+			compatible = "ti,twl4030-vaux4";
+			regulator-min-microvolt = <2800000>;
+			regulator-max-microvolt = <3150000>;
+		};
+		/* GPS LNA */
+		vsim: regulator-vsim {
+			compatible = "ti,twl4030-vsim";
+			regulator-min-microvolt = <2800000>;
+			regulator-max-microvolt = <3150000>;
+		};
+		/* backup battery charger */
+		charger: bci {
+			ti,bb-uvolt = <3200000>;
+			ti,bb-uamp = <150>;
+		};
+		twl_audio: audio {
+			compatible = "ti,twl4030-audio";
+
+			ti,enable-vibra = <1>;
+
+			codec {
+				ti,ramp_delay_value = <3>;
+			};
 		};
 	};
 };
@@ -209,19 +459,25 @@ 
 
 	/* accelerometer */
 	bma180@41 {
+		/* we use the BMA150 Input (CONFIG_INPUT_BMA150) driver */
 		compatible = "bosch,bma180";
 		reg = <0x41>;
-		interrupt-parent = <&gpio3>;
-		interrupts = <19 IRQ_TYPE_LEVEL_HIGH>;
+		pinctrl-names = "default";
+		pintcrl-0 = <&bma180_pins>;
+		interrupt-parent = <&gpio4>;
+		interrupts = <19 (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING)>;
 	};
 
 	/* leds */
-	tca6507@45 {
+	tca_gpios: tca6507@45 {
 		compatible = "ti,tca6507";
 		#address-cells = <1>;
 		#size-cells = <0>;
 		reg = <0x45>;
 
+		gpio-controller;
+		#gpio-cells = <2>;
+
 		gta04_led0: red_aux@0 {
 			label = "gta04:red:aux";
 			reg = <0x0>;
@@ -242,12 +498,11 @@ 
 			label = "gta04:green:power";
 			reg = <0x4>;
 		};
-	};
 
-	/* compass aka magnetometer */
-	hmc5843@1e {
-		compatible = "honeywell,hmc5843";
-		reg = <0x1e>;
+		wifi_reset: wifi_reset@6 { /* reference as <&tca_gpios 0 0> since it is currently the only GPIO */
+			reg = <0x6>;
+			compatible = "gpio";
+		};
 	};
 
 	/* touchscreen */
@@ -256,13 +511,54 @@ 
 		reg = <0x48>;
 		interrupt-parent = <&gpio6>;
 		interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
-		gpios = <&gpio6 0 GPIO_ACTIVE_LOW>;
-		ti,x-plate-ohms = <600>;
+		gpios = <&gpio6 0 GPIO_ACTIVE_LOW>;	/* gpio_160 */
+		ti,x-plate-ohms = <550>;
+		ti,rng_x = <123 456>;
+		ti,rng_y = <123 456>;
+		ti,rng_z = <123 456>;
+		ti,flip_x = <0>;
+		ti,flip_y = <1>;
+		ti,swap_xy = <0>;
+	};
+
+	/* compass aka magnetometer */
+	hmc5843@1e {
+		compatible = "honeywell,hmc5883l";
+		reg = <0x1e>;
+		vdd-supply = <&vaux2>;
 	};
+
+	/* gyroscope */
+	itg3200@68 {
+		compatible = "invensense,itg3200";
+		reg = <0x68>;
+		vdd-supply = <&vaux2>;
+	};
+
+	/* RFID EEPROM */
+	m24lr64@50 {
+		compatible = "at,24c64";
+		reg = <0x50>;
+	};
+
+	/* camera */
+	ov9655@30 {
+		compatible = "omnivision,ov9655";
+		reg = <0x30>;
+		vdd_ana-supply = <&vaux3>;
+	};
+
+	/* FM Radio (no kernel driver) */
+	si4721_codec: si4721@11 {
+		compatible = "silicon-labs,si4721";
+		reg = <0x11>;
+	};
+
 };
 
 &i2c3 {
 	clock-frequency = <100000>;
+	/* unused */
 };
 
 &usb_otg_hs {
@@ -286,35 +582,124 @@ 
 	vmmc-supply = <&vaux4>;
 	bus-width = <4>;
 	ti,non-removable;
+	reset-gpios = <&tca_gpios 0 GPIO_ACTIVE_LOW>;	/* W2CBW003 reset through tca6507 */
 };
 
 &mmc3 {
 	status = "disabled";
 };
 
-&uart1 {
+&uart1 { /* Bluetooth /dev/ttyO0 */
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart1_pins>;
+	dtr-gpio = <&bt_en 0 GPIO_ACTIVE_LOW>;	/* w2cbw bluetooth power control through virtual gpio */
 };
 
-&uart2 {
+&uart2 { /* GPS /dev/ttyO1 */
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart2_pins>;
+	dtr-gpio = <&gps_en 0 GPIO_ACTIVE_HIGH>;	/* w2sg0004 GPS power control through virtual gpio */
 };
 
-&uart3 {
+&uart3 { /* Console and IrDA /dev/ttyO2 */
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart3_pins>;
 };
 
+&usbhshost {
+	port2-mode = "ehci-phy";
+};
+
+&usbhsehci {
+	phys = <0 &hsusb2_phy>;
+};
+
 &charger {
 	bb_uvolt = <3200000>;
 	bb_uamp = <150>;
 };
 
-&vaux4 {
-	regulator-min-microvolt = <2800000>;
-	regulator-max-microvolt = <3150000>;
+&venc {
+	status = "ok";
+
+	vdda-supply = <&vdac>;
+
+	port {
+		venc_out: endpoint {
+			remote-endpoint = <&tv_connector_in>;
+			ti,channels = <2>;
+		};
+	};
+};
+
+&gpmc {
+	ranges = <0 0 0x30000000 0x04>;       /* CS0: NAND */
+
+	nand@0,0 {
+		reg = <0 0 0>; /* CS0, offset 0 */
+		nand-bus-width = <16>;
+		ti,nand-ecc-opt = "bch8";
+
+		gpmc,sync-clk-ps = <0>;
+		gpmc,cs-on-ns = <0>;
+		gpmc,cs-rd-off-ns = <44>;
+		gpmc,cs-wr-off-ns = <44>;
+		gpmc,adv-on-ns = <6>;
+		gpmc,adv-rd-off-ns = <34>;
+		gpmc,adv-wr-off-ns = <44>;
+		gpmc,we-off-ns = <40>;
+		gpmc,oe-off-ns = <54>;
+		gpmc,access-ns = <64>;
+		gpmc,rd-cycle-ns = <82>;
+		gpmc,wr-cycle-ns = <82>;
+		gpmc,wr-access-ns = <40>;
+		gpmc,wr-data-mux-bus-ns = <0>;
+		gpmc,device-width = <2>;
+
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		x-loader@0 {
+			label = "X-Loader";
+			reg = <0 0x80000>;
+		};
+
+		bootloaders@80000 {
+			label = "U-Boot";
+			reg = <0x80000 0x1e0000>;
+		};
+
+		bootloaders_env@260000 {
+			label = "U-Boot Env";
+			reg = <0x260000 0x20000>;
+		};
+
+		kernel@280000 {
+			label = "Kernel";
+			reg = <0x280000 0x400000>;
+		};
+
+		filesystem@680000 {
+			label = "File System";
+			reg = <0x680000 0xf980000>;
+		};
+	};
+};
+
+&mcbsp1 {
+	status = "okay";
+};
+
+&mcbsp2 {
+	status = "okay";
+};
+
+&mcbsp3 {
+	status = "okay";
+};
+
+&mcbsp4 {
+	status = "okay";
 };
 
 /* Needed to power the DPI pins */
@@ -335,7 +720,3 @@ 
 		};
 	};
 };
-
-&twl_madc {
-	ti,system-uses-second-madc-irq;
-};