On Wed, Sep 13, 2017 at 10:50:28AM -0700, Stephen Graf wrote:
> I am trying to get an i2c driver working on orange pi one (H3).
> Reading the H3 datasheet would lead me to believe that the switwi driver
> should work.  The H3 data is the same except for 2 additional extended
> feature registers that should not be needed.
> 
> I modified the dtb and the sxitwi driver to set up H3 compatibility, rebuilt
> the kernel and got the following in the dmesg:
> 
> sxitwi0 at simplebus0sxiccmu_ccu_enable: 0x0000003b
> 
> iic0 at sxitwi0
> sxitwi1 at simplebus0sxiccmu_ccu_enable: 0x0000003c
> 
> iic1 at sxitwi1
> sxitwi2 at simplebus0sxiccmu_ccu_enable: 0x0000003d
> 
> iic2 at sxitwi2
> 
> Now I am stuck trying to write some code to test the driver. I have a device
> on the i2c bus iic1 at address 76, a bme280 temperature, pressure and
> humidity sensor.
> I am not an accomplished c programmer and would dearly like to see an
> example of using iic to read and write a device on the i2c bus.
> 
> Note: I do not see nor can create iicx or switwi devices.  
> 

Hi,

after you've finished what patrick@ wrote about, you might want to take
a look at i/sys/dev/fdt/axp20x.c, it could very well be the simplest
driver on iic-bus in tree, and consequently it does attach to sxitwi* :)

-Artturi

Reply via email to