From 375d135818f32bbe7b3f071bd54d977c4ff8d84a Mon Sep 17 00:00:00 2001 From: Ondrej Zary Date: Sat, 19 Mar 2011 16:32:53 +0100 Subject: ALSA: tea575x-tuner: various improvements Improve tea575x-tuner with various good things from radio-maestro: - extend frequency range to 50-150MHz - fix querycap(): card name, CAP_RADIO - improve g_tuner(): CAP_STEREO, stereo and tuned indication - improve g_frequency(): tuner index checking and reading frequency from HW - improve s_frequency(): tuner index and type checking Signed-off-by: Ondrej Zary Signed-off-by: Takashi Iwai --- include/sound/tea575x-tuner.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/sound') diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index 5718a02d3afb..3d6cdd80df59 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h @@ -38,8 +38,10 @@ struct snd_tea575x { struct snd_card *card; struct video_device *vd; /* video device */ int dev_nr; /* requested device number + 1 */ - int tea5759; /* 5759 chip is present */ - int mute; /* Device is muted? */ + bool tea5759; /* 5759 chip is present */ + bool mute; /* Device is muted? */ + bool stereo; /* receiving stereo */ + bool tuned; /* tuned to a station */ unsigned int freq_fixup; /* crystal onboard */ unsigned int val; /* hw value */ unsigned long freq; /* frequency */ -- cgit v1.2.3 From f8960d61bc8ba945b07a4de1288aac5d52f8607b Mon Sep 17 00:00:00 2001 From: Ondrej Zary Date: Sat, 19 Mar 2011 16:33:01 +0100 Subject: ALSA: tea575x-tuner: remove dev_nr Remove unused dev_nr from struct tea575x_tuner. Signed-off-by: Ondrej Zary Signed-off-by: Takashi Iwai --- include/sound/tea575x-tuner.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/sound') diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index 3d6cdd80df59..5aade569439b 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h @@ -37,7 +37,6 @@ struct snd_tea575x_ops { struct snd_tea575x { struct snd_card *card; struct video_device *vd; /* video device */ - int dev_nr; /* requested device number + 1 */ bool tea5759; /* 5759 chip is present */ bool mute; /* Device is muted? */ bool stereo; /* receiving stereo */ -- cgit v1.2.3 From 66b5b9722b8743f83d4c3f11f39665f5f2c40b12 Mon Sep 17 00:00:00 2001 From: Dimitris Papastamos Date: Wed, 16 Mar 2011 12:16:39 +0000 Subject: ALSA: Add snd_ctl_replace() to dynamically replace a control Add a function to dynamically replace a given control. If the control does not already exist, a third parameter is used to determine whether to actually add that control. This is useful in cases where downloadable firmware at runtime can add or replace existing controls. A separate patch needs to be made to allow ALSA Mixer to render the replaced controls on the fly. Signed-off-by: Dimitris Papastamos Signed-off-by: Takashi Iwai --- include/sound/control.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sound') diff --git a/include/sound/control.h b/include/sound/control.h index e67db2869360..40423810985a 100644 --- a/include/sound/control.h +++ b/include/sound/control.h @@ -113,6 +113,7 @@ struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new * kcontrolnew, v void snd_ctl_free_one(struct snd_kcontrol * kcontrol); int snd_ctl_add(struct snd_card * card, struct snd_kcontrol * kcontrol); int snd_ctl_remove(struct snd_card * card, struct snd_kcontrol * kcontrol); +int snd_ctl_replace(struct snd_card *card, struct snd_kcontrol *kcontrol, bool add_on_replace); int snd_ctl_remove_id(struct snd_card * card, struct snd_ctl_elem_id *id); int snd_ctl_rename_id(struct snd_card * card, struct snd_ctl_elem_id *src_id, struct snd_ctl_elem_id *dst_id); int snd_ctl_activate_id(struct snd_card *card, struct snd_ctl_elem_id *id, -- cgit v1.2.3 From 14219d06592025541559027d0fd8f96ef75f313c Mon Sep 17 00:00:00 2001 From: Ondrej Zary Date: Mon, 9 May 2011 23:39:26 +0200 Subject: ALSA: tea575x: unify read/write functions Implement generic read/write functions to access TEA575x tuners. They're now implemented 4 times (once in es1968 and 3 times in fm801). This also allows mute to work on all cards. Also improve tuner detection/initialization. Signed-off-by: Ondrej Zary Signed-off-by: Takashi Iwai --- include/sound/tea575x-tuner.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'include/sound') diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index 5aade569439b..e50cb2934efe 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h @@ -26,12 +26,17 @@ #include #include +#define TEA575X_DATA (1 << 0) +#define TEA575X_CLK (1 << 1) +#define TEA575X_WREN (1 << 2) +#define TEA575X_MOST (1 << 3) + struct snd_tea575x; struct snd_tea575x_ops { - void (*write)(struct snd_tea575x *tea, unsigned int val); - unsigned int (*read)(struct snd_tea575x *tea); - void (*mute)(struct snd_tea575x *tea, unsigned int mute); + 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); }; struct snd_tea575x { @@ -49,7 +54,7 @@ struct snd_tea575x { void *private_data; }; -void snd_tea575x_init(struct snd_tea575x *tea); +int snd_tea575x_init(struct snd_tea575x *tea); void snd_tea575x_exit(struct snd_tea575x *tea); #endif /* __SOUND_TEA575X_TUNER_H */ -- cgit v1.2.3 From ea27316e4cd13b25727715c0db8adb0b1661f5e7 Mon Sep 17 00:00:00 2001 From: Ondrej Zary Date: Thu, 12 May 2011 22:17:56 +0200 Subject: ALSA: tea575x: remove freq_fixup from struct freq_fixup is a constant, no need to hold it in struct snd_tea575x and set in each driver. Signed-off-by: Ondrej Zary Signed-off-by: Takashi Iwai --- include/sound/tea575x-tuner.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/sound') diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index e50cb2934efe..0291f48e035e 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h @@ -26,6 +26,8 @@ #include #include +#define TEA575X_FMIF 10700 + #define TEA575X_DATA (1 << 0) #define TEA575X_CLK (1 << 1) #define TEA575X_WREN (1 << 2) @@ -46,7 +48,6 @@ struct snd_tea575x { bool mute; /* Device is muted? */ bool stereo; /* receiving stereo */ bool tuned; /* tuned to a station */ - unsigned int freq_fixup; /* crystal onboard */ unsigned int val; /* hw value */ unsigned long freq; /* frequency */ unsigned long in_use; /* set if the device is in use */ -- cgit v1.2.3 From 3d11ba5593b801b1db85e9680d585713e6039112 Mon Sep 17 00:00:00 2001 From: Ondrej Zary Date: Thu, 12 May 2011 22:18:09 +0200 Subject: ALSA: tea575x: remove unused card from struct struct snd_card *card is present in struct snd_tea575x but never used. Remove it. Signed-off-by: Ondrej Zary Signed-off-by: Takashi Iwai --- include/sound/tea575x-tuner.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/sound') diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index 0291f48e035e..42ce8cd7616f 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h @@ -42,7 +42,6 @@ struct snd_tea575x_ops { }; struct snd_tea575x { - struct snd_card *card; struct video_device *vd; /* video device */ bool tea5759; /* 5759 chip is present */ bool mute; /* Device is muted? */ -- cgit v1.2.3 From 10ca72014741554ad37c149ff0d9e93c1e3d5b7d Mon Sep 17 00:00:00 2001 From: Ondrej Zary Date: Thu, 12 May 2011 22:18:22 +0200 Subject: ALSA: tea575x: use better card and bus names Provide real card and bus_info instead of hardcoded values. Signed-off-by: Ondrej Zary Signed-off-by: Takashi Iwai --- include/sound/tea575x-tuner.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/sound') diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index 42ce8cd7616f..d2ea112fc20f 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h @@ -52,6 +52,8 @@ struct snd_tea575x { unsigned long in_use; /* set if the device is in use */ struct snd_tea575x_ops *ops; void *private_data; + u8 card[32]; + u8 bus_info[32]; }; int snd_tea575x_init(struct snd_tea575x *tea); -- cgit v1.2.3