linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v9 0/2] sun4i-codec: Add Line-In, FM-In, Mic 2, Capture Source, Differential Line-In
@ 2016-08-29 18:03 Danny Milosavljevic
  2016-08-29 18:03 ` [PATCH v9 1/2] ASoC: sun4i-codec: Distinguish sun4i from sun7i Danny Milosavljevic
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Danny Milosavljevic @ 2016-08-29 18:03 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds support for some mixer controls:
* Line-In
* FM-In
* Mic 2
* Capture Source
* Differential Line-In

v9 changes compared to v8 are:
 - added Line Differential Capture Switch.
 - split Capture Source into Left Capture Select, Right Capture Select.
 - added Line Capture Volume.
 - rename "sun4i_codec_widgets" to "sun4i_codec_controls" for 
   consistency with the struct field it's used in.
 - rename "Line-In" to "Line".
 - rename "Power Amplifier Playback Volume" to "Headphone Playback Volume".

v8 changes compared to v7 are:
 - fixed the routes for line and mic capturing.

v7 changes compared to v6 are:
 - preparation for different A20, A10 controls is now in an extra patch.
 - all register definitions are now at the top.
 - sun7i-specific things (A20-specific things) are now less grouped-together.
 - rename "Power Amplifier Volume" to "Power Amplifier Playback Volume".

v6 changes compared to v5 are:
 - Mic preamplifier special cases for A20 and A10 now are now not icky:
   There are two different _widget arrays and the probe() function now 
   selects the right one to pass to snd_soc_register_codec() unmodified.
 - sun7i-specific things (A20-specific things) are now grouped together.

v5 changes compared to v4 are:
 - Mic preamplifier controls have more common names now.
 - Mic preamplifier scale has a 0 dB entry as well now, as documented in the 
   A20 user manual.
 - Mic preamplifier has special cases for A20 and A10 now.
 - Gain controls have "Gain" in the name now.

v4 changes compared to v3 are:
 - names of the input are not uppercase anymore.
 - bit index constants are now named as in the A20 user manual v1.4.
 - added Mic1-In, Mac2-In.
 - added Mic1 and Mic2 Pre-Amplifiers.

v3 changes compared to v2 are:
 - added DAPM routes.

v2 changes compared to v1 are:
 - moved Line-In and FM-In playback switches to their respective 
   sun4i_codec_*_mixer_controls.

v1 changes:
 - added linein, fmin output volumes and switches.

Danny Milosavljevic (2):
  ASoC: sun4i-codec: Distinguish sun4i from sun7i
  Add mixer controls: Line-In, FM-In, Mic 2, Capture Source,
    Differential Line-In.

 sound/soc/sunxi/sun4i-codec.c | 278 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 259 insertions(+), 19 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v9 1/2] ASoC: sun4i-codec: Distinguish sun4i from sun7i
  2016-08-29 18:03 [PATCH v9 0/2] sun4i-codec: Add Line-In, FM-In, Mic 2, Capture Source, Differential Line-In Danny Milosavljevic
@ 2016-08-29 18:03 ` Danny Milosavljevic
  2016-08-29 18:03 ` [PATCH v9 2/2] Add mixer controls: Line-In, FM-In, Mic 2, Capture Source, Differential Line-In Danny Milosavljevic
       [not found] ` <jwvh9a29z9n.fsf-monnier+gmane.comp.hardware.netbook.arm.sunxi@gnu.org>
  2 siblings, 0 replies; 6+ messages in thread
From: Danny Milosavljevic @ 2016-08-29 18:03 UTC (permalink / raw)
  To: linux-arm-kernel


This distinguishes sun4i from sun7i. It is necessary because they use
different registers for the audio mixer.
---
 sound/soc/sunxi/sun4i-codec.c | 44 +++++++++++++++++++++++++++++++++----------
 1 file changed, 34 insertions(+), 10 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ASoC-sun4i-codec-Distinguish-sun4i-from-sun7i.patch
Type: text/x-patch
Size: 3488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160829/6c2b94d6/attachment.bin>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v9 2/2] Add mixer controls: Line-In, FM-In, Mic 2, Capture Source, Differential Line-In.
  2016-08-29 18:03 [PATCH v9 0/2] sun4i-codec: Add Line-In, FM-In, Mic 2, Capture Source, Differential Line-In Danny Milosavljevic
  2016-08-29 18:03 ` [PATCH v9 1/2] ASoC: sun4i-codec: Distinguish sun4i from sun7i Danny Milosavljevic
@ 2016-08-29 18:03 ` Danny Milosavljevic
  2016-08-30  6:49   ` [linux-sunxi] " Code Kipper
       [not found] ` <jwvh9a29z9n.fsf-monnier+gmane.comp.hardware.netbook.arm.sunxi@gnu.org>
  2 siblings, 1 reply; 6+ messages in thread
From: Danny Milosavljevic @ 2016-08-29 18:03 UTC (permalink / raw)
  To: linux-arm-kernel


Note: Mic1 Capture Volume is in a different register on A20 than on A10.
Note: Mic2 Capture Volume is in a different register on A20 than on A10.
---
 sound/soc/sunxi/sun4i-codec.c | 256 ++++++++++++++++++++++++++++++++++++++----
 1 file changed, 236 insertions(+), 20 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-mixer-controls-Line-In-FM-In-Mic-2-Capture-Sourc.patch
Type: text/x-patch
Size: 14407 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160829/d211fd2a/attachment.bin>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [linux-sunxi] [PATCH v9 2/2] Add mixer controls: Line-In, FM-In, Mic 2, Capture Source, Differential Line-In.
  2016-08-29 18:03 ` [PATCH v9 2/2] Add mixer controls: Line-In, FM-In, Mic 2, Capture Source, Differential Line-In Danny Milosavljevic
@ 2016-08-30  6:49   ` Code Kipper
  2016-08-30 18:10     ` Danny Milosavljevic
  0 siblings, 1 reply; 6+ messages in thread
From: Code Kipper @ 2016-08-30  6:49 UTC (permalink / raw)
  To: linux-arm-kernel

On 29 August 2016 at 20:03, Danny Milosavljevic <dannym@scratchpost.org> wrote:
>
> Note: Mic1 Capture Volume is in a different register on A20 than on A10.
> Note: Mic2 Capture Volume is in a different register on A20 than on A10.
> ---
>  sound/soc/sunxi/sun4i-codec.c | 256 ++++++++++++++++++++++++++++++++++++++----
>  1 file changed, 236 insertions(+), 20 deletions(-)
Hi Danny,
I think this should be delivered in a series of patches like what I've
attempted to do here
https://github.com/codekipper/linux-sunxi/commits/sunxi-wip?page=2
I haven't worked with my A20 for a while which is why I haven't
delivered these changes, however summer is coming to an end and should
be able to retest and deliver soon.
I can see that there is a difference like you've mentioned between the
A10 and A20 with the MIC pre-amps so approve of the use of a common
array.
Something also looks wrong with the whitespacing for sun4i_codec_codec.
BR,
CK
>
> --
> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [linux-sunxi] Re: [PATCH v9 0/2] sun4i-codec: Add Line-In, FM-In, Mic 2, Capture Source, Differential Line-In
       [not found] ` <jwvh9a29z9n.fsf-monnier+gmane.comp.hardware.netbook.arm.sunxi@gnu.org>
@ 2016-08-30 17:39   ` Danny Milosavljevic
  0 siblings, 0 replies; 6+ messages in thread
From: Danny Milosavljevic @ 2016-08-30 17:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 30 Aug 2016 09:12:48 -0400
Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> >  - rename "Line-In" to "Line".  
> 
> Curious: why?

Documentation/sound/alsa/ControlNames.txt line 49

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [linux-sunxi] [PATCH v9 2/2] Add mixer controls: Line-In, FM-In, Mic 2, Capture Source, Differential Line-In.
  2016-08-30  6:49   ` [linux-sunxi] " Code Kipper
@ 2016-08-30 18:10     ` Danny Milosavljevic
  0 siblings, 0 replies; 6+ messages in thread
From: Danny Milosavljevic @ 2016-08-30 18:10 UTC (permalink / raw)
  To: linux-arm-kernel

Hi CK,

On Tue, 30 Aug 2016 08:49:40 +0200
Code Kipper <codekipper@gmail.com> wrote:

> On 29 August 2016 at 20:03, Danny Milosavljevic <dannym@scratchpost.org> wrote:
> I think this should be delivered in a series of patches like what I've
> attempted to do here
> https://github.com/codekipper/linux-sunxi/commits/sunxi-wip?page=2

Feel free to do it. But I've gotten questions from users why they have to
apply my patch manually again and again, so let's get this done one way
or another.

> I haven't worked with my A20 for a while which is why I haven't
> delivered these changes, however summer is coming to an end and should
> be able to retest and deliver soon.

Good :)

Please check whether you use the same routes and registers in your
version - my patch has been in use by multiple people for months
so I'm quite positive that it works, whatever cosmetic issues there may be.

Especially pay attention to Line Playback Volume - it has two possible values.

0 means -1.5 dB and 1 means 0 dB. Many userspace tools seem to be confused
about it not being a boolean and alsa-lib also did stupid stuff with it
depending on the name. So make sure that it does work.

Also if someone tests my patch, please also test this.

(It has been notoriously difficult to reproduce this problem reliably
 in the past with different people's setups)

> I can see that there is a difference like you've mentioned between the
> A10 and A20 with the MIC pre-amps so approve of the use of a common
> array.

Yeah, it's necessary.

> Something also looks wrong with the whitespacing for sun4i_codec_codec.

Depends on your tab width - the committed version used Tab characters in
order to line up the equals signs. So it was really just luck how it looked.

That means that depending on the tab width it did either line up or not
(it didn't line up for me).

Now it's using spaces around the equal sign and so it shows up
the same for everyone - lined up. I fixed this because I touched the line
anyway.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-08-30 18:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-29 18:03 [PATCH v9 0/2] sun4i-codec: Add Line-In, FM-In, Mic 2, Capture Source, Differential Line-In Danny Milosavljevic
2016-08-29 18:03 ` [PATCH v9 1/2] ASoC: sun4i-codec: Distinguish sun4i from sun7i Danny Milosavljevic
2016-08-29 18:03 ` [PATCH v9 2/2] Add mixer controls: Line-In, FM-In, Mic 2, Capture Source, Differential Line-In Danny Milosavljevic
2016-08-30  6:49   ` [linux-sunxi] " Code Kipper
2016-08-30 18:10     ` Danny Milosavljevic
     [not found] ` <jwvh9a29z9n.fsf-monnier+gmane.comp.hardware.netbook.arm.sunxi@gnu.org>
2016-08-30 17:39   ` [linux-sunxi] Re: [PATCH v9 0/2] sun4i-codec: Add " Danny Milosavljevic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).