PINE64
GPIO specifications in device tree - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4)
+--- Forum: Linux on Pine A64(+) (https://forum.pine64.org/forumdisplay.php?fid=6)
+--- Thread: GPIO specifications in device tree (/showthread.php?tid=7063)



GPIO specifications in device tree - ramstadt - 01-16-2019

The CS4270 allows specifying a reset GPIO using the following code:

enum of_gpio_flags flags;
int gpio = of_get_named_gpio_flags(np, "reset-gpio", 0, &flags);

if (gpio_is_valid(gpio)) {
ret = devm_gpio_request_one(&i2c_client->dev, gpio,
     flags & OF_GPIO_ACTIVE_LOW ?
GPIOF_OUT_INIT_LOW : GPIOF_OUT_INIT_HIGH,
     "cs4270 reset");
if (ret < 0)
return ret;
}

I cannot figure out how to alter my device tree specification to specify PC11 as the reset line for my codec.  My codec looks like this:

codec0: i2s-codec@0x48 {
compatible = "cirrus,cs4270";
reg = <0x48>;
va-supply = <&va_reg>;
vd-supply = <&vd_reg>;
vlc-supply = <&vlc_reg>;
};

I'm currently using Armbian with the 3.10.107 kernel.

Thanks,
Bob


RE: GPIO specifications in device tree - ramstadt - 01-16-2019

I now understand that there is a difference between the sunxi pinctrl format and the gpio format that CS4270 is expecting. The gpio.txt document indicates that GPIOs are specified as a number and a flags value. SUNXI functions specify GPIOs as 6 different numbers of bank, # in bank, etc. How do I create a gpio node in the device tree that I can use to specify the reset is on PC11 (gpio 75) in the 2 cell format?