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>
    }; 
原文地址:https://www.cnblogs.com/dakewei/p/12322476.html