refine sdw_rt711_rt1308_rt715 - #1796
Conversation
|
|
||
| #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_COMMON_HDMI_CODEC) | ||
| static struct snd_soc_jack hdmi[3]; | ||
| #if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI) |
There was a problem hiding this comment.
This is conflict with #1794. And we already depends on SND_HDA_CODEC_HDMI on Kconfig.
There was a problem hiding this comment.
@bardliao Ack, let's go with the approach with #1794 .
@RanderWang Once 1794 is merged, I think this patch is still needed. You could make similar change as I did in #1777 and make HDMI optional at runtime.
|
|
||
| #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_COMMON_HDMI_CODEC) | ||
| static struct snd_soc_jack hdmi[3]; | ||
| #if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI) |
There was a problem hiding this comment.
@bardliao Ack, let's go with the approach with #1794 .
@RanderWang Once 1794 is merged, I think this patch is still needed. You could make similar change as I did in #1777 and make HDMI optional at runtime.
| for (i = 0; i < hdmi_num; i++) { | ||
| struct snd_soc_dai_link_component *idisp_components; | ||
|
|
||
| idisp_components = devm_kzalloc(dev, sizeof(*idisp_components), |
There was a problem hiding this comment.
Why do you want to allocate them one by one? What was wrong with allocating the whole array at once?
There was a problem hiding this comment.
@lyakh First this array is defined out of #ifdef HDMI_CODE but used here. So if HDMI is not defined, I got a build warning message. I don't want to add anther #ifdef HDMI for definition of this array, so I moved the definition into this loop.
There was a problem hiding this comment.
@RanderWang so you prefer to run 4 kmalloc calls with error handling in the likely case of HDMI being used (in about 100% of the cases) to having one more #ifdef? That doesn't seem like a good choice to me. #ifdefs are frowned upon in the Linux kernel in .c files, that's true, but we have a ton of them around... And you can certainly find many ways to avoid that additional #ifdef. In fact you can avoid them completely here. You can use the if (hdmi_num > 0) clause above, but that would add indentation. Or you can make a new function. Either way choosing code aesthetics and sacrificing run-time doesn't seem a good solution to me in this case.
| return -ENOMEM; | ||
| } | ||
|
|
||
| for (i = 0; i < hdmi_num; i++) { |
There was a problem hiding this comment.
Unless there's a real practical reason for this, please, revert. Please keep the array.
| /* | ||
| * dai link id of SSP & DMIC & HDMI are based on last | ||
| * link id used by sdw link. The dai_id is not always equal | ||
| * to id for dai link id may be changed by some sdw codecs. |
There was a problem hiding this comment.
Let's capitalise: "DAI," "ID," not sure what the preferred way for "sdw" is - it isn't an acronym, so, maybe in small is ok.
There was a problem hiding this comment.
In your comment you say, that you unified the acronym style by writing them all in lower-case, but here it's still mixed. And I don't think "hdmi" is a widely-accepted style, so I'd really use "HDMI," "DAI," "ID"... But let's see what others say, maybe I'm wrong on this.
There was a problem hiding this comment.
yes, I grep git log and sound, HDMI DAI ID is more popular
There was a problem hiding this comment.
...and still this comment hasn't been updated.
| * on generic TGL platform, I2S or SDW mode is supported | ||
| * based on board rework. A acpi device is registered in | ||
| * system only when I2S mode is supported, not SDW mode. | ||
| * Here check acpi id to confirm I2S is supported. |
There was a problem hiding this comment.
"ACPI," "ID" - also in the commit message. It looks a bit weird to me to see "I2S," "TGL," "SDW capitalised and "ACPI" and "ID" - not. BTW, there's again the question for "SDW" vs. "sdw." Also "An ACPI" both here and in the commit message
There was a problem hiding this comment.
thanks , I will unify the style
b5dc85c to
646a527
Compare
| * dai id is fixed at 4 for 715 to keep sdw | ||
| * dmic and hdmi setting static in ucm | ||
| */ | ||
| dai_links->id = 4; |
There was a problem hiding this comment.
If this has to agree with UCM, this is a part of the user ABI, right? Then we might need some macros for all such values...
| ssp_num = hweight_long(ssp_mask); | ||
| /* | ||
| * on generic tgl platform, i2s or sdw mode is supported | ||
| * based on board rework. A acpi device is registered in |
There was a problem hiding this comment.
"acpi" and "i2s" isn't a commonly accepted style IMHO
There was a problem hiding this comment.
I search acpi & ACPI, i2s & I2S in git log. yes, ACPI & I2S is more popular. Thanks! I will refine it
6d8e8e2 to
4634dad
Compare
|
@lyakh thanks for your advice. I update my PR to adopt formal style. Tested on Comet Lake-U, Comet Lake-H and Tiger Lake RVP. |
Use CONFIG_SND_HDA_CODEC_HDMI instead of SND_SOC_SOF_HDA_COMMON_HDMI_CODEC which is deleted by commit 8c10db2 ("ASoC: SOF: Intel: hda: remove SND_SOC_SOF_HDA_COMMON_HDMI_CODEC"). Also fix build warning when CONFIG_SND_HDA_CODEC_HDMI is not defined. Now the maximum HDMI count on intel platform is 4, so increase HDMI jack count to 4. On Tiger Lake, 4 HDMI jacks are used, and only 3 on platforms before Tiger Lake. Tested on Comet Lake-U, Comet Lake-H and Tiger Lake RVP. Signed-off-by: randerwang <rander.wang@linux.intel.com>
bardliao
left a comment
There was a problem hiding this comment.
Thanks @RanderWang LGTM now
|
fix the conflict file |
64b2a04 to
bdf5cc8
Compare
…itude To make sdw DMIC & HDMI setting static in UCM, DAI link ID of rt715 is fixed at 4 in topology file. Refine machine driver according to this change. Signed-off-by: randerwang <rander.wang@linux.intel.com>
… mode On generic Tiger Lake platform, I2S or sdw mode is supported based on board rework. A ACPI device is registered in system only when I2S mode is supported, not sdw mode. Here check ACPI ID to confirm whether I2S mode is supported. Signed-off-by: randerwang <rander.wang@linux.intel.com>
|
update PR, check platform quirk info then fix DAI ID of rt711 at 4 |
|
Tested it with latest PR1796, it can work and no side effect. |
We do not use struct socket in unix_autobind() and pass struct sock to unix_bind_bsd() and unix_bind_abstract(). Let's pass it to unix_autobind() as well. Also, this patch fixes these errors by checkpatch.pl. ERROR: do not use assignment in if condition thesofproject#1795: FILE: net/unix/af_unix.c:1795: + if (test_bit(SOCK_PASSCRED, &sock->flags) && !u->addr CHECK: Logical continuations should be on the previous line thesofproject#1796: FILE: net/unix/af_unix.c:1796: + if (test_bit(SOCK_PASSCRED, &sock->flags) && !u->addr + && (err = unix_autobind(sock)) != 0) Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Refine HDMI support for recent changes
Fix DMIC id at 4
Tested on Comet Lake U & H. Tiger Lake with 1308 in SDW mode and I2S mode
fixes #1788