[alsa-devel] [PATCH 4/6] ALSA: hda/ca0132: Don't test for QUIRK_NONE
Alastair Bridgewater
alastair.bridgewater at gmail.com
Sat Jun 16 05:11:53 CEST 2018
My inconvenience from the R3Di/SBZ changes has been minor at worst.
Actually, the timing on this has been very good. Finding the R3Di
patches and QemuHDADump two weeks ago, just as I was starting to look
again into trying to improve sound support on my M17x R4 was a
pleasant surprise. Yes, there are rough edges, but they're the sort
of thing that should get caught by careful code review or from testing
various -rc kernels. And you'll get better at this if you keep at it.
Speaking of rough edges, QUIRK_SBZ and QUIRK_R3DI have code paths that
use both ca0132_alt_select_in() (from ca0132_init() and the input
source control) and ca0132_select_mic() (from amic_callback(), tied to
a jack detect). I'm fairly certain that this is wrong.
On Fri, Jun 15, 2018 at 10:20 PM, Connor McAdams <conmanx360 at gmail.com>
wrote:
> Good call. Please understand that I'm fairly new to all of this, so
> mistakes like this are more due to being ignorant than anything else.
> I was afraid certain things may end up broken by my changes, and I
> hope it didn't inconvenience you.
>
> On Fri, Jun 15, 2018 at 9:56 PM, Alastair Bridgewater
> <alastair.bridgewater at gmail.com> wrote:
> > QUIRK_NONE is, quite explicitly, the default case. The entire
> > point of a quirks system is to allow "programming by difference"
> > from a given base case, which requires that merely defining a new
> > quirk for some piece of hardware should not change the behavior of
> > the driver for that hardware. In turn, this means that testing
> > for QUIRK_NONE explicitly is a violation of that implicit contract.
> >
> > Change a test for QUIRK_NONE and QUIRK_ALIENWARE to default, and
> > add a test for QUIRK_SBZ to disable the default behavior in that
> > instance.
> >
> > Signed-off-by: Alastair Bridgewater <alastair.bridgewater at gmail.com>
> >
> > diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
> > index ca7375e48138..71487b82eef5 100644
> > --- a/sound/pci/hda/patch_ca0132.c
> > +++ b/sound/pci/hda/patch_ca0132.c
> > @@ -7237,8 +7237,9 @@ static int ca0132_init(struct hda_codec *codec)
> > case QUIRK_R3DI:
> > r3di_setup_defaults(codec);
> > break;
> > - case QUIRK_NONE:
> > - case QUIRK_ALIENWARE:
> > + case QUIRK_SBZ:
> > + break;
> > + default:
> > ca0132_setup_defaults(codec);
> > ca0132_init_analog_mic2(codec);
> > ca0132_init_dmic(codec);
> > --
> > 2.16.1
> >
> > _______________________________________________
> > Alsa-devel mailing list
> > Alsa-devel at alsa-project.org
> > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
More information about the Alsa-devel
mailing list