From 32a9bb83491141451e0422a56c57518505e50250 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Fri, 18 May 2012 09:36:17 -0300 Subject: [PATCH] --- yaml --- r: 320551 b: refs/heads/master c: 31a62d415726d94bae5caf5f2e50232aa06babf6 h: refs/heads/master i: 320549: 7f8edea798f73826be291848eee407b21274bb27 320547: 4884088542b64676d9d9b755739e47cdf858fd66 320543: 5668c9579858968fbf04c6308d60d038ce0337b2 v: v3 --- [refs] | 2 +- trunk/include/sound/tea575x-tuner.h | 4 ++++ trunk/sound/i2c/other/tea575x-tuner.c | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 347b7aeb6bdc..85496414ef9b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9bc31633c20ca6a49071f2162c232ae556151cc2 +refs/heads/master: 31a62d415726d94bae5caf5f2e50232aa06babf6 diff --git a/trunk/include/sound/tea575x-tuner.h b/trunk/include/sound/tea575x-tuner.h index 0c3c2fb0f939..7bd6f6145a38 100644 --- a/trunk/include/sound/tea575x-tuner.h +++ b/trunk/include/sound/tea575x-tuner.h @@ -37,6 +37,10 @@ struct snd_tea575x; struct snd_tea575x_ops { + /* Drivers using snd_tea575x must either define read_ and write_val */ + void (*write_val)(struct snd_tea575x *tea, u32 val); + u32 (*read_val)(struct snd_tea575x *tea); + /* Or define the 3 pin functions */ void (*set_pins)(struct snd_tea575x *tea, u8 pins); u8 (*get_pins)(struct snd_tea575x *tea); void (*set_direction)(struct snd_tea575x *tea, bool output); diff --git a/trunk/sound/i2c/other/tea575x-tuner.c b/trunk/sound/i2c/other/tea575x-tuner.c index b29b88f93c9e..080aae9d1198 100644 --- a/trunk/sound/i2c/other/tea575x-tuner.c +++ b/trunk/sound/i2c/other/tea575x-tuner.c @@ -71,6 +71,9 @@ static void snd_tea575x_write(struct snd_tea575x *tea, unsigned int val) u16 l; u8 data; + if (tea->ops->write_val) + return tea->ops->write_val(tea, val); + tea->ops->set_direction(tea, 1); udelay(16); @@ -94,6 +97,9 @@ static u32 snd_tea575x_read(struct snd_tea575x *tea) u16 l, rdata; u32 data = 0; + if (tea->ops->read_val) + return tea->ops->read_val(tea); + tea->ops->set_direction(tea, 0); tea->ops->set_pins(tea, 0); udelay(16);