diff options
author | Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> | 2012-04-22 08:55:10 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-20 12:45:01 -0300 |
commit | 1e73eea781bc302ba7f35da89d627bd355a7814a (patch) | |
tree | 8a618353b8530b6cf4a97c35c1a06fd85bd3a38d /drivers/media/video/smiapp/smiapp-regs.c | |
parent | [media] smiapp: Allow using external clock from the clock framework (diff) | |
download | linux-dev-1e73eea781bc302ba7f35da89d627bd355a7814a.tar.xz linux-dev-1e73eea781bc302ba7f35da89d627bd355a7814a.zip |
[media] smiapp: Pass struct sensor to register writing commands instead of i2c_client
Pass struct sensor to register access commands. This allows taking quirks
into account in register access.
Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/smiapp/smiapp-regs.c')
-rw-r--r-- | drivers/media/video/smiapp/smiapp-regs.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/media/video/smiapp/smiapp-regs.c b/drivers/media/video/smiapp/smiapp-regs.c index a5055f18091f..e5e5f4356dd2 100644 --- a/drivers/media/video/smiapp/smiapp-regs.c +++ b/drivers/media/video/smiapp/smiapp-regs.c @@ -25,6 +25,7 @@ #include <linux/delay.h> #include <linux/i2c.h> +#include "smiapp.h" #include "smiapp-regs.h" static uint32_t float_to_u32_mul_1000000(struct i2c_client *client, @@ -77,8 +78,9 @@ static uint32_t float_to_u32_mul_1000000(struct i2c_client *client, * Read a 8/16/32-bit i2c register. The value is returned in 'val'. * Returns zero if successful, or non-zero otherwise. */ -int smiapp_read(struct i2c_client *client, u32 reg, u32 *val) +int smiapp_read(struct smiapp_sensor *sensor, u32 reg, u32 *val) { + struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd); struct i2c_msg msg; unsigned char data[4]; unsigned int len = (u8)(reg >> 16); @@ -145,8 +147,9 @@ err: * Write to a 8/16-bit register. * Returns zero if successful, or non-zero otherwise. */ -int smiapp_write(struct i2c_client *client, u32 reg, u32 val) +int smiapp_write(struct smiapp_sensor *sensor, u32 reg, u32 val) { + struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd); struct i2c_msg msg; unsigned char data[6]; unsigned int retries; |