Linux 3.4-rc2 register mapping and paging on I2C device.

dd diasemi
2012-04-30T17:31:40Z

Hello Mark,

I need to implement a I2C MFD driver that requires register page
switching. It is not supported by regmap currently and requires
additional effort to make it clean. What is the best (most clean) way
of implementing a driver with register page switching?

I have come up with few alternatives:
1. Write the driver without regmap, with separate I2C routines.
2. After a call to devm_regmap_init_i2c(), exchange regmap.bus.read,
regmap.bus.write and regmap.bus.gather_write with specific handlers
(supporting register page switching). Those handlers would call
original I2C bus handlers indirectly, by passing altered registers.
3. Update regmap API to enable support for register page switching.

Let me know what you think,

many thanks,

Krystian