[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <15648946-3b87-69db-914c-354dce1abcac@loongson.cn>
Date: Fri, 31 Jul 2020 16:48:59 +0800
From: Kaige Li <likaige@...ngson.cn>
To: Takashi Iwai <tiwai@...e.de>
Cc: Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
Keyon Jie <yang.jie@...ux.intel.com>,
Sameer Pujar <spujar@...dia.com>,
Mohan Kumar <mkumard@...dia.com>,
Alex Deucher <alexander.deucher@....com>,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
Xuefeng Li <lixuefeng@...ngson.cn>,
Tiezhu Yang <yangtiezhu@...ngson.cn>
Subject: Re: [RFC] ALSA: hda: Add workaround to adapt to Loongson 7A1000
controller
On 07/31/2020 02:29 PM, Takashi Iwai wrote:
> On Fri, 31 Jul 2020 04:41:54 +0200,
> Kaige Li wrote:
>> There's some issues that cause palyback without a sound on Loongson
>> platform (3A3000 + 7A1000) with a Realtek ALC269 codec. After lengthy
>> debugging sessions, we solved it by adding workaround.
>>
>> Signed-off-by: Kaige Li <likaige@...ngson.cn>
> Thanks for the patch. But this can't be taken as is due to the design
> problem. Namely...
>
>> --- a/sound/hda/hdac_controller.c
>> +++ b/sound/hda/hdac_controller.c
>> @@ -9,6 +9,7 @@
>> #include <sound/core.h>
>> #include <sound/hdaudio.h>
>> #include <sound/hda_register.h>
>> +#include "../pci/hda/hda_controller.h"
> ... here already suspicious, and ...
>
>> #include "local.h"
>>
>> /* clear CORB read pointer properly */
>> @@ -42,6 +43,8 @@ static void azx_clear_corbrp(struct hdac_bus *bus)
>> */
>> void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus)
>> {
>> + struct azx *chip = bus_to_azx(bus);
> ... here you cast the hdac_bus object to its child class. This is
> disallowed, as it's a layer violation and would break if another child
> class like ASoC driver is used with this patch.
>
> IOW, inside the code in sound/hda/*, you must not use the contents in
> sound/pci/hda/* and include/sound/hda_codec.h.
>
> If any new workaround is needed, introduce a new flag in struct
> hdac_bus.
Thank you for your reply and suggestions. I will review it, and see how
hdac_bus works.
Thanks,
Kaige
> thanks,
>
> Takashi
Powered by blists - more mailing lists