tea575x: remove freq_fixup from struct
Subsystems (2)
PATCH 1/3 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 <[email protected]>
include/sound/tea575x-tuner.h +2 -1
@@ -26,6 +26,8 @@#include <media/v4l2-dev.h> #include <media/v4l2-ioctl.h> +#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 */
sound/i2c/other/tea575x-tuner.c +4 -4
@@ -141,9 +141,9 @@ static void snd_tea575x_get_freq(struct freq /=10 ;/* crystal fixup */ if (tea->tea5759) - freq += tea->freq_fixup; + freq +=TEA575X_FMIF ;else - freq -= tea->freq_fixup; + freq -=TEA575X_FMIF ; tea->freq = freq *16 ;/* from kHz */ }
@@ -156,9 +156,9 @@ static void snd_tea575x_set_freq(struct freq /=16 ;/* to kHz */ /* crystal fixup */ if (tea->tea5759) - freq -= tea->freq_fixup; + freq -=TEA575X_FMIF ;else - freq += tea->freq_fixup; + freq +=TEA575X_FMIF ;/* freq /= 12.5 */ freq *=10 ; freq /=125 ;
sound/pci/es1968.c +0 -1
@@ -2794,7 +2794,6 @@ static int __devinit snd_es1968_create(s#ifdef CONFIG_SND_ES1968_RADIO chip->tea.card = card; - chip->tea.freq_fixup =10700 ; chip->tea.private_data = chip; chip->tea.ops = &snd_es1968_tea_ops;if (!snd_tea575x_init (&chip->tea))
sound/pci/fm801.c +0 -1
@@ -1231,7 +1231,6 @@ static int __devinit snd_fm801_create(st#ifdef TEA575X_RADIO chip->tea.card = card; - chip->tea.freq_fixup =10700 ; chip->tea.private_data = chip; chip->tea.ops = &snd_fm801_tea_ops; if ((tea575x_tuner & TUNER_TYPE_MASK) > 0 &&
Signature · 1 line
Ondrej Zary
Takashi Iwai
AppliedAt Thu, 12 May 2011 22:17:56 +0200,
Quoted 5 lines · Ondrej Zary
freq_fixupis a constant, no need to hold it in structsnd_tea575xand set in each driver.Signed-off-by Ondrej Zary <[email protected]>
Thanks, applied all three patches.
Takashi
Quoted 74 lines
include/sound/tea575x-tuner.h +2
-1@@ -26,6 +26,8 @@#include <media/v4l2-dev.h> #include <media/v4l2-ioctl.h> +#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 */ sound/i2c/other/tea575x-tuner.c +4
-4@@ -141,9 +141,9 @@ static void snd_tea575x_get_freq(struct freq /=10 ;/* crystal fixup */ if (tea->tea5759) - freq += tea->freq_fixup; + freq +=TEA575X_FMIF ;else - freq -= tea->freq_fixup; + freq -=TEA575X_FMIF ; tea->freq = freq *16 ;/* from kHz */ }@@ -156,9 +156,9 @@ static void snd_tea575x_set_freq(struct freq /=16 ;/* to kHz */ /* crystal fixup */ if (tea->tea5759) - freq -= tea->freq_fixup; + freq -=TEA575X_FMIF ;else - freq += tea->freq_fixup; + freq +=TEA575X_FMIF ;/* freq /= 12.5 */ freq *=10 ; freq /=125 ;sound/pci/es1968.c +0
-1@@ -2794,7 +2794,6 @@ static int __devinit snd_es1968_create(s#ifdef CONFIG_SND_ES1968_RADIO chip->tea.card = card; - chip->tea.freq_fixup =10700 ; chip->tea.private_data = chip; chip->tea.ops = &snd_es1968_tea_ops;if (!snd_tea575x_init (&chip->tea))sound/pci/fm801.c +0
-1@@ -1231,7 +1231,6 @@ static int __devinit snd_fm801_create(st#ifdef TEA575X_RADIO chip->tea.card = card; - chip->tea.freq_fixup =10700 ; chip->tea.private_data = chip; chip->tea.ops = &snd_fm801_tea_ops; if ((tea575x_tuner & TUNER_TYPE_MASK) > 0 &&Signature · 6 lines
-- Ondrej Zary _______________________________________________ Alsa-devel mailing list [email protected] http://mailman.alsa-project.org/mailman/listinfo/alsa-devel