How to change the GPIO values which are defined in dts files?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to change the GPIO values which are defined in dts files?

1,799件の閲覧回数
dilshad_alam
Senior Contributor II

#define MX6QDL_PAD_SD4_DAT5__GPIO2_IO13             0x354 0x73c 0x000 0x5 0x0

This pin mux is configured in arch/arm/boots/dts/imx6dl-pinfunc.h

Would like to use this GPIO pin as output and status as high to enable my Wifi Chip.

I have made these changes in my dt node.

&usdhc2 {

  pinctrl-names = "default";

  pinctrl-0 = <&pinctrl_usdhc2_2>;

  bus-width = <4>;

    cd-gpios = <&gpio2 13 0>;

  wp-gpios = <&gpio2 13 0>;

  /* no-1-8-v; */

  vmmc-supply = <&reg_3p3v>;

  keep-power-in-suspend;

  enable-sdio-wakeup;

  status = "okay";

};

I need to pull this pin low for 10 ms. How do I change this in code?

ラベル(2)
0 件の賞賛
返信
2 返答(返信)

1,462件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi Dilshad

please look at

http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/gpio/gpio.txt

Definitive GPIO guide - Studio Kousagi Wiki

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信

1,462件の閲覧回数
dilshad_alam
Senior Contributor II

Hi Igor,

I have tried accessing GPIO's defined in my source code using gpio_request. It;s failing with error 16( Device resouce Busy error EBUSY)

boarddata->cd_gpio = of_get_named_gpio(np, "cd-gpios", 0);

err = devm_gpio_request(&host->mmc->class_dev, boarddata->cd_gpio,"wlanen");

  if (err) {

  dev_err(mmc_dev(host->mmc),

  "failed to request wlan en gpio!\n");

  }

Could you please let me know why its failing?

0 件の賞賛
返信