Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Add the APDS9960 proximity sensor kernel module #42

Merged
merged 1 commit into from
May 13, 2016

Conversation

yongli3
Copy link
Contributor

@yongli3 yongli3 commented May 12, 2016

The apds9960 device driver needs a GPIO as the IRQ resource,
Add this kernel module to provide the IRQ resource on Galileo boards

Signed-off-by: Yong Li [email protected]

@yongli3
Copy link
Contributor Author

yongli3 commented May 12, 2016

@pohly @jlaako @barbieri This PR is related to #39, they are used to enable the proximity sensors for solettaproject/soletta#1971. Please help to review

int i = 0;
struct i2c_adapter *adap = NULL;

for (i = 0; i < 10; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any cleaner way to do this than just iterate max 10 times? Where does the number 10 come from? Maybe there is a function to fetch number of i2c adapters?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just want to enumerate all i2c adapters and find the one connected to external devices, but I did not find the API for the total i2c adapters. Since the total number is board related, and Galileo boards only have one i2c adapter, I changed the code to use adapter 0.

The apds9960 device driver needs a GPIO as the IRQ resource,
Add this kernel module to provide the IRQ resource on Galileo boards

Signed-off-by: Yong Li <[email protected]>
@jlaako jlaako merged commit ef395b8 into ostroproject:master May 13, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants