linux內核如何為gpio 擴展芯片驅動添加設備節點?


1. 關注屬性gpio-hog

   GPIO hogging is a mechanism providing automatic GPIO request and configuration as part of the gpio-controller's driver probe function.(gpio-hog是一種提供自動gpio資源申請並且配置為gpio控制器驅動探測函數的一部分的機制)
2. 舉例
    pca9554:pca9554@20 {
  compatible = "nxp,pca9554";
  reg=<0x20>;
    gpio-controller;
  #gpio-cells=<2>;
  interrupt-controller;
  #interrupt-cells = <2>;
  interrupt-parent = <&gpio3>;
  interrupts = <28 IRQ_TYPE_NONE>;

      P00 {
    gpio-hog;
    gpios = <0 GPIO_ACTIVE_LOW>;
    output-high;
    line-name = "led_normal";
  }
    }
3. 如何引用pca9554節點?
  displayport {
        dp.aux_sw_oe = <&pca9554 4 GPIO_ACTIVE_HIGH>
        dp.sbu_sw_sel = <&pca9554 1 GPIO_ACTIVE_HIGH>
    }; 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM