Re: [alsa-devel] [PATCH v5] [resend] radio-sf16fmr2: convert to generic TEA575x interface

2011-05-26 Thread Takashi Iwai
At Wed, 25 May 2011 21:21:30 -0300,
Mauro Carvalho Chehab wrote:
> 
> Em 23-05-2011 09:17, Ondrej Zary escreveu:
> > Convert radio-sf16fmr2 to use generic TEA575x implementation. Most of the
> > driver code goes away as SF16-FMR2 is basically just a TEA5757 tuner
> > connected to ISA bus.
> > The card can optionally be equipped with PT2254A volume control (equivalent
> > of TC9154AP) - the volume setting is completely reworked (with balance 
> > control
> > added) and tested.
> 
> Ondrej,
> 
> As your first series went via alsa tree, and we are close to the end of the 
> merge window,
> and assuming that Takashi didn't apply those patches on his tree, as you're 
> re-sending it,
> I think that the better is to wait for the end of the merge window, in order 
> to allow us
> to sync our development tree with 2.6.40-rc1, and then review and apply it on 
> the top of it.

Yeah, I didn't pick it up as the patches are rather V4L-side changes
(although tea575x.c is in sound sub-directory).
And I agree with Mauro - let's merge it after rc1, so that we stand on
the same ground.  This sort of cross-tree change is better done at the
fixed point than in flux like during merge window.

That being said, I don't mind that Mauro or Hans applies these through
V4L tree.  In that case, you can take my acks for both patches.

Acked-by: Takashi Iwai 

Of if it's preferred through sound tree, I can take them later.


thanks,

Takashi


> Thanks,
> Mauro.
> 
> > 
> > Signed-off-by: Ondrej Zary 
> > 
> > --- linux-2.6.39-rc2-/sound/pci/Kconfig 2011-05-15 18:50:18.0 
> > +0200
> > +++ linux-2.6.39-rc2/sound/pci/Kconfig  2011-05-17 23:35:30.0 
> > +0200
> > @@ -565,8 +565,8 @@ config SND_FM801_TEA575X_BOOL
> >  
> >  config SND_TEA575X
> > tristate
> > -   depends on SND_FM801_TEA575X_BOOL || SND_ES1968_RADIO
> > -   default SND_FM801 || SND_ES1968
> > +   depends on SND_FM801_TEA575X_BOOL || SND_ES1968_RADIO || RADIO_SF16FMR2
> > +   default SND_FM801 || SND_ES1968 || RADIO_SF16FMR2
> >  
> >  source "sound/pci/hda/Kconfig"
> >  
> > --- linux-2.6.39-rc2-/drivers/media/radio/radio-sf16fmr2.c  2011-04-06 
> > 03:30:43.0 +0200
> > +++ linux-2.6.39-rc2/drivers/media/radio/radio-sf16fmr2.c   2011-05-19 
> > 17:56:08.0 +0200
> > @@ -1,441 +1,209 @@
> > -/* SF16FMR2 radio driver for Linux radio support
> > - * heavily based on fmi driver...
> > - * (c) 2000-2002 Ziglio Frediano, fredd...@angelfire.com
> > +/* SF16-FMR2 radio driver for Linux
> > + * Copyright (c) 2011 Ondrej Zary
> >   *
> > - * Notes on the hardware
> > - *
> > - *  Frequency control is done digitally -- ie out(port,encodefreq(95.8));
> > - *  No volume control - only mute/unmute - you have to use line volume
> > - *
> > - *  For read stereo/mono you must wait 0.1 sec after set frequency and
> > - *  card unmuted so I set frequency on unmute
> > - *  Signal handling seem to work only on autoscanning (not implemented)
> > - *
> > - *  Converted to V4L2 API by Mauro Carvalho Chehab 
> > + * Original driver was (c) 2000-2002 Ziglio Frediano, 
> > fredd...@angelfire.com
> > + * but almost nothing remained here after conversion to generic TEA575x
> > + * implementation
> >   */
> >  
> > +#include 
> >  #include   /* Modules  */
> >  #include /* Initdata */
> >  #include   /* request_region   */
> > -#include/* udelay   */
> > -#include/* kernel radio structs */
> > -#include 
> > -#include   /* for KERNEL_VERSION MACRO */
> >  #include   /* outb, outb_p */
> > -#include 
> > -#include 
> > +#include 
> >  
> > -MODULE_AUTHOR("Ziglio Frediano, fredd...@angelfire.com");
> > -MODULE_DESCRIPTION("A driver for the SF16FMR2 radio.");
> > +MODULE_AUTHOR("Ondrej Zary");
> > +MODULE_DESCRIPTION("MediaForte SF16-FMR2 FM radio card driver");
> >  MODULE_LICENSE("GPL");
> >  
> > -static int io = 0x384;
> > -static int radio_nr = -1;
> > -
> > -module_param(io, int, 0);
> > -MODULE_PARM_DESC(io, "I/O address of the SF16FMR2 card (should be 0x384, 
> > if do not work try 0x284)");
> > -module_param(radio_nr, int, 0);
> > -
> > -#define RADIO_VERSION KERNEL_VERSION(0,0,2)
> > -
> > -#define AUD_VOL_INDEX 1
> > -
> > -#undef DEBUG
> > -//#define DEBUG 1
> > -
> > -#ifdef DEBUG
> > -# define  debug_print(s) printk s
> > -#else
> > -# define  debug_print(s)
> > -#endif
> > -
> > -/* this should be static vars for module size */
> > -struct fmr2
> > -{
> > -   struct v4l2_device v4l2_dev;
> > -   struct video_device vdev;
> > -   struct mutex lock;
> > +struct fmr2 {
> > int io;
> > -   int curvol; /* 0-15 */
> > -   int mute;
> > -   int stereo; /* card is producing stereo audio */
> > -   unsigned long curfreq; /* freq in kHz */
> > -   int card_type;
> > +   struct snd_tea575x tea;
> > +   struct v4l2_ctrl *volume;
> > +   struct v4l2_ctrl *balance;
> >  };
> >  
> > +/* the port is hardwired so no need

Re: [alsa-devel] [PATCH v5] [resend] radio-sf16fmr2: convert to generic TEA575x interface

2011-06-01 Thread Mauro Carvalho Chehab
Em 26-05-2011 04:45, Takashi Iwai escreveu:
> At Wed, 25 May 2011 21:21:30 -0300,
> Mauro Carvalho Chehab wrote:
>>
>> Em 23-05-2011 09:17, Ondrej Zary escreveu:
>>> Convert radio-sf16fmr2 to use generic TEA575x implementation. Most of the
>>> driver code goes away as SF16-FMR2 is basically just a TEA5757 tuner
>>> connected to ISA bus.
>>> The card can optionally be equipped with PT2254A volume control (equivalent
>>> of TC9154AP) - the volume setting is completely reworked (with balance 
>>> control
>>> added) and tested.
>>
>> Ondrej,
>>
>> As your first series went via alsa tree, and we are close to the end of the 
>> merge window,
>> and assuming that Takashi didn't apply those patches on his tree, as you're 
>> re-sending it,
>> I think that the better is to wait for the end of the merge window, in order 
>> to allow us
>> to sync our development tree with 2.6.40-rc1, and then review and apply it 
>> on the top of it.
> 
> Yeah, I didn't pick it up as the patches are rather V4L-side changes
> (although tea575x.c is in sound sub-directory).
> And I agree with Mauro - let's merge it after rc1, so that we stand on
> the same ground.  This sort of cross-tree change is better done at the
> fixed point than in flux like during merge window.

Hmm.. I tried to apply it after -rc1. It didn't apply:

Applying patch 
patches/lmml_808552_v5_resend_radio_sf16fmr2_convert_to_generic_tea575x_interface.patch
patching file sound/pci/Kconfig
patching file drivers/media/radio/radio-sf16fmr2.c
Hunk #1 FAILED at 1.
1 out of 2 hunks FAILED -- rejects in file drivers/media/radio/radio-sf16fmr2.c
Patch 
patches/lmml_808552_v5_resend_radio_sf16fmr2_convert_to_generic_tea575x_interface.patch
 does not apply (enforce with -f)

Is there any missing patches, or is it just due to some other changes from the
alsa tree?

Ondrej,

Could you please rebase this patch on the top of staging/for_v3.0 branch at
git://linuxtv.org/media_tree.git tree?

The other patch applied ok (tea575x: convert to control framework), so I've
already applied it here.

> 
> That being said, I don't mind that Mauro or Hans applies these through
> V4L tree.  In that case, you can take my acks for both patches.
> 
> Acked-by: Takashi Iwai 
> 
> Of if it's preferred through sound tree, I can take them later.


> 
> 
> thanks,
> 
> Takashi
> 
> 
>> Thanks,
>> Mauro.
>>
>>>
>>> Signed-off-by: Ondrej Zary 
>>>
>>> --- linux-2.6.39-rc2-/sound/pci/Kconfig 2011-05-15 18:50:18.0 
>>> +0200
>>> +++ linux-2.6.39-rc2/sound/pci/Kconfig  2011-05-17 23:35:30.0 
>>> +0200
>>> @@ -565,8 +565,8 @@ config SND_FM801_TEA575X_BOOL
>>>  
>>>  config SND_TEA575X
>>> tristate
>>> -   depends on SND_FM801_TEA575X_BOOL || SND_ES1968_RADIO
>>> -   default SND_FM801 || SND_ES1968
>>> +   depends on SND_FM801_TEA575X_BOOL || SND_ES1968_RADIO || RADIO_SF16FMR2
>>> +   default SND_FM801 || SND_ES1968 || RADIO_SF16FMR2
>>>  
>>>  source "sound/pci/hda/Kconfig"
>>>  
>>> --- linux-2.6.39-rc2-/drivers/media/radio/radio-sf16fmr2.c  2011-04-06 
>>> 03:30:43.0 +0200
>>> +++ linux-2.6.39-rc2/drivers/media/radio/radio-sf16fmr2.c   2011-05-19 
>>> 17:56:08.0 +0200
>>> @@ -1,441 +1,209 @@
>>> -/* SF16FMR2 radio driver for Linux radio support
>>> - * heavily based on fmi driver...
>>> - * (c) 2000-2002 Ziglio Frediano, fredd...@angelfire.com
>>> +/* SF16-FMR2 radio driver for Linux
>>> + * Copyright (c) 2011 Ondrej Zary
>>>   *
>>> - * Notes on the hardware
>>> - *
>>> - *  Frequency control is done digitally -- ie out(port,encodefreq(95.8));
>>> - *  No volume control - only mute/unmute - you have to use line volume
>>> - *
>>> - *  For read stereo/mono you must wait 0.1 sec after set frequency and
>>> - *  card unmuted so I set frequency on unmute
>>> - *  Signal handling seem to work only on autoscanning (not implemented)
>>> - *
>>> - *  Converted to V4L2 API by Mauro Carvalho Chehab 
>>> + * Original driver was (c) 2000-2002 Ziglio Frediano, 
>>> fredd...@angelfire.com
>>> + * but almost nothing remained here after conversion to generic TEA575x
>>> + * implementation
>>>   */
>>>  
>>> +#include 
>>>  #include   /* Modules  */
>>>  #include /* Initdata */
>>>  #include   /* request_region   */
>>> -#include/* udelay   */
>>> -#include/* kernel radio structs */
>>> -#include 
>>> -#include   /* for KERNEL_VERSION MACRO */
>>>  #include   /* outb, outb_p */
>>> -#include 
>>> -#include 
>>> +#include 
>>>  
>>> -MODULE_AUTHOR("Ziglio Frediano, fredd...@angelfire.com");
>>> -MODULE_DESCRIPTION("A driver for the SF16FMR2 radio.");
>>> +MODULE_AUTHOR("Ondrej Zary");
>>> +MODULE_DESCRIPTION("MediaForte SF16-FMR2 FM radio card driver");
>>>  MODULE_LICENSE("GPL");
>>>  
>>> -static int io = 0x384;
>>> -static int radio_nr = -1;
>>> -
>>> -module_param(io, int, 0);
>>> -MODULE_PARM_DESC(io, "I/O address of the SF16FMR2 card

Re: [alsa-devel] [PATCH v5] [resend] radio-sf16fmr2: convert to generic TEA575x interface

2011-06-01 Thread Ondrej Zary
On Wednesday 01 June 2011 17:45:31 Mauro Carvalho Chehab wrote:
> Em 26-05-2011 04:45, Takashi Iwai escreveu:
> > At Wed, 25 May 2011 21:21:30 -0300,
> >
> > Mauro Carvalho Chehab wrote:
> >> Em 23-05-2011 09:17, Ondrej Zary escreveu:
> >>> Convert radio-sf16fmr2 to use generic TEA575x implementation. Most of
> >>> the driver code goes away as SF16-FMR2 is basically just a TEA5757
> >>> tuner connected to ISA bus.
> >>> The card can optionally be equipped with PT2254A volume control
> >>> (equivalent of TC9154AP) - the volume setting is completely reworked
> >>> (with balance control added) and tested.
> >>
> >> Ondrej,
> >>
> >> As your first series went via alsa tree, and we are close to the end of
> >> the merge window, and assuming that Takashi didn't apply those patches
> >> on his tree, as you're re-sending it, I think that the better is to wait
> >> for the end of the merge window, in order to allow us to sync our
> >> development tree with 2.6.40-rc1, and then review and apply it on the
> >> top of it.
> >
> > Yeah, I didn't pick it up as the patches are rather V4L-side changes
> > (although tea575x.c is in sound sub-directory).
> > And I agree with Mauro - let's merge it after rc1, so that we stand on
> > the same ground.  This sort of cross-tree change is better done at the
> > fixed point than in flux like during merge window.
>
> Hmm.. I tried to apply it after -rc1. It didn't apply:
>
> Applying patch
> patches/lmml_808552_v5_resend_radio_sf16fmr2_convert_to_generic_tea575x_int
>erface.patch patching file sound/pci/Kconfig
> patching file drivers/media/radio/radio-sf16fmr2.c
> Hunk #1 FAILED at 1.
> 1 out of 2 hunks FAILED -- rejects in file
> drivers/media/radio/radio-sf16fmr2.c Patch
> patches/lmml_808552_v5_resend_radio_sf16fmr2_convert_to_generic_tea575x_int
>erface.patch does not apply (enforce with -f)
>
> Is there any missing patches, or is it just due to some other changes from
> the alsa tree?

It fails because of a stupid typo comment fix:
-/* !!! not tested, in my card this does't work !!! */
+/* !!! not tested, in my card this doesn't work !!! */


-- 
Ondrej Zary
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html