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. >
Looks like you need to implement support for H3's I2C clock in sxiccmu, so it's powered on properly. That could help. Could. Patrick