Skip to contentSkip to conversation

twl4030-core: allow reading entire register banks

PATCH Applied David Brownell 3 participants 3 messages Nov 7, 2008 – Nov 13, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 twl4030-core: allow reading entire register banks

From: David Brownell <[email protected]>

Minor change to the TWL4030 utility interface: support reads of all 256 bytes in each register bank (vs just 255). This can help when debugging, but is otherwise a NOP.

---
 drivers/mfd/twl4030-core.c  |    4 ++--
 include/linux/i2c/twl4030.h |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/mfd/twl4030-core.c +2 -2
@@ -233,7 +233,7 @@ extern void twl4030_power_init(struct tw
  *
  * Returns the result of operation - 0 is success
  */
-int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, u8 num_bytes)
+int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes)
 {
 	int ret;
 	int sid;
@@ -282,7 +282,7 @@ EXPORT_SYMBOL(twl4030_i2c_write);
  *
  * Returns result of operation - num_bytes is success else failure.
  */
-int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, u8 num_bytes)
+int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes)
 {
 	int ret;
 	u8 val;
include/linux/i2c/twl4030.h +2 -2
@@ -78,8 +78,8 @@ int twl4030_i2c_read_u8(u8 mod_no, u8 *v
  * IMPORTANT:  For twl4030_i2c_write(), allocate num_bytes + 1
  * for the value, and populate your data starting at offset 1.
  */
-int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, u8 num_bytes);
-int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, u8 num_bytes);
+int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
+int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
 
 /*----------------------------------------------------------------------*/
 
Applied
#1 lore raw
Quoted 5 lines · David Brownell

From: David Brownell <[email protected]>

Minor change to the TWL4030 utility interface: support reads of all 256 bytes in each register bank (vs just 255). This can help when debugging, but is otherwise a NOP.

Applied to my for-next branch.
Thanks David.

Cheers,
Samuel.

Quoted 39 lines
---
 drivers/mfd/twl4030-core.c  |    4 ++--
 include/linux/i2c/twl4030.h |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/mfd/twl4030-core.c +2 -2
@@ -233,7 +233,7 @@ extern void twl4030_power_init(struct tw
  *
  * Returns the result of operation - 0 is success
  */
-int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, u8 num_bytes)
+int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes)
 {
 	int ret;
 	int sid;
@@ -282,7 +282,7 @@ EXPORT_SYMBOL(twl4030_i2c_write);
  *
  * Returns result of operation - num_bytes is success else failure.
  */
-int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, u8 num_bytes)
+int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes)
 {
 	int ret;
 	u8 val;
include/linux/i2c/twl4030.h +2 -2
@@ -78,8 +78,8 @@ int twl4030_i2c_read_u8(u8 mod_no, u8 *v
  * IMPORTANT:  For twl4030_i2c_write(), allocate num_bytes + 1
  * for the value, and populate your data starting at offset 1.
  */
-int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, u8 num_bytes);
-int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, u8 num_bytes);
+int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
+int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
 
 /*----------------------------------------------------------------------*/
 
Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/
maintainer
#2 lore raw
Quoted 8 lines · Samuel Ortiz
Quoted 5 lines · David Brownell

From: David Brownell <[email protected]>

Minor change to the TWL4030 utility interface: support reads of all 256 bytes in each register bank (vs just 255). This can help when debugging, but is otherwise a NOP.

Applied to my for-next branch.
Thanks David.

Pushing also to linux-omap while waiting for this patch to fall down from the mainline kernel.

Tony

Quoted 52 lines

Cheers,
Samuel.

Quoted 39 lines
---
 drivers/mfd/twl4030-core.c  |    4 ++--
 include/linux/i2c/twl4030.h |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/mfd/twl4030-core.c +2 -2
@@ -233,7 +233,7 @@ extern void twl4030_power_init(struct tw
  *
  * Returns the result of operation - 0 is success
  */
-int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, u8 num_bytes)
+int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes)
 {
 	int ret;
 	int sid;
@@ -282,7 +282,7 @@ EXPORT_SYMBOL(twl4030_i2c_write);
  *
  * Returns result of operation - num_bytes is success else failure.
  */
-int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, u8 num_bytes)
+int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes)
 {
 	int ret;
 	u8 val;
include/linux/i2c/twl4030.h +2 -2
@@ -78,8 +78,8 @@ int twl4030_i2c_read_u8(u8 mod_no, u8 *v
  * IMPORTANT:  For twl4030_i2c_write(), allocate num_bytes + 1
  * for the value, and populate your data starting at offset 1.
  */
-int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, u8 num_bytes);
-int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, u8 num_bytes);
+int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
+int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
 
 /*----------------------------------------------------------------------*/
 
Signature · 7 lines
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/