aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sound/tea575x-tuner.h4
-rw-r--r--sound/i2c/other/tea575x-tuner.c6
2 files changed, 10 insertions, 0 deletions
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h
index 0c3c2fb0f939..7bd6f6145a38 100644
--- a/include/sound/tea575x-tuner.h
+++ b/include/sound/tea575x-tuner.h
@@ -37,6 +37,10 @@
37struct snd_tea575x; 37struct snd_tea575x;
38 38
39struct snd_tea575x_ops { 39struct snd_tea575x_ops {
40 /* Drivers using snd_tea575x must either define read_ and write_val */
41 void (*write_val)(struct snd_tea575x *tea, u32 val);
42 u32 (*read_val)(struct snd_tea575x *tea);
43 /* Or define the 3 pin functions */
40 void (*set_pins)(struct snd_tea575x *tea, u8 pins); 44 void (*set_pins)(struct snd_tea575x *tea, u8 pins);
41 u8 (*get_pins)(struct snd_tea575x *tea); 45 u8 (*get_pins)(struct snd_tea575x *tea);
42 void (*set_direction)(struct snd_tea575x *tea, bool output); 46 void (*set_direction)(struct snd_tea575x *tea, bool output);
diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c
index b29b88f93c9e..080aae9d1198 100644
--- a/sound/i2c/other/tea575x-tuner.c
+++ b/sound/i2c/other/tea575x-tuner.c
@@ -71,6 +71,9 @@ static void snd_tea575x_write(struct snd_tea575x *tea, unsigned int val)
71 u16 l; 71 u16 l;
72 u8 data; 72 u8 data;
73 73
74 if (tea->ops->write_val)
75 return tea->ops->write_val(tea, val);
76
74 tea->ops->set_direction(tea, 1); 77 tea->ops->set_direction(tea, 1);
75 udelay(16); 78 udelay(16);
76 79
@@ -94,6 +97,9 @@ static u32 snd_tea575x_read(struct snd_tea575x *tea)
94 u16 l, rdata; 97 u16 l, rdata;
95 u32 data = 0; 98 u32 data = 0;
96 99
100 if (tea->ops->read_val)
101 return tea->ops->read_val(tea);
102
97 tea->ops->set_direction(tea, 0); 103 tea->ops->set_direction(tea, 0);
98 tea->ops->set_pins(tea, 0); 104 tea->ops->set_pins(tea, 0);
99 udelay(16); 105 udelay(16);