1

Is there a good example device-tree-aware i2c gpio driver for Linux?

I've been looking at gpio-pcf857x but it has a header file containing struct pcf857x_platform_data which is used in board files.

I am looking for a similar example, but where the i2c id is defined-in/retrieved-from the device tree.

4
  • Have you checked other drivers there? gpio-pca953x supports it at least. ID is retrived via compatible strings as far as I know. Commented Apr 22, 2017 at 8:44
  • 1
    Take a look at max732x.c driver. Corresponding bindings documentation (for driver references you are looking for) is at Documentation/devicetree/bindings/gpio/. Commented Apr 22, 2017 at 11:03
  • @SamProtsenko I used the max732.c as a base and it worked well. Make your comment an answer and I'll accept it. Commented May 17, 2017 at 9:51
  • 1
    @chrisdew Done. Commented May 17, 2017 at 10:19

1 Answer 1

1

Take a look at driver (code). As for I2C ID table usage -- see this answer.

Corresponding bindings documentation (for driver references you are looking for) is at Documentation/devicetree/bindings/gpio/.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.