Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASoC: Intel: sof_rt5682 add support for HDMI_In capture #4470

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

apoorvintel
Copy link

Adding support for 2 streams of HDMI-In capture via I2S with rt5682s codec variant

HI @bardliao , @CBala21 Please review

@sofci
Copy link
Collaborator

sofci commented Jul 10, 2023

Can one of the admins verify this patch?

reply test this please to run this test once

(((quirk) << SOF_NO_OF_HDMI_CAPTURE_SSP_SHIFT) & SOF_NO_OF_HDMI_CAPTURE_SSP_MASK)

#define SOF_HDMI_CAPTURE_1_SSP_SHIFT 30
#define SOF_HDMI_CAPTURE_1_SSP_MASK (GENMASK(32, 30))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to define sof_rt5682_quirk as u64 now... see line 83

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our observation from test is unsigned long sof_rt5682_quirk is supported 64 bit when its compiled with X64 flag enabled.
the issue is during macro assignment and shift , SOF_HDMI_CAPTURE_1_SSP(quirk)=> quirk is treated as 32 bit and throws complier warning. Hence we need to do temporary type casting to make it as 64 bit variable.

Copy link

@CBala21 CBala21 Jul 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overflow_warning

this warning has been fixed with typecasting and code is working as expected.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for typecast, use u64 for the quirk.

Copy link

@CBala21 CBala21 Jul 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have tried with unsigned long long sof_rt5682_quirk but it doesn't help to fix the compiler warning. I understand that warning is not related to sof_rt5682_quirk data type.
looks Its related to macro variable SOF_HDMI_CAPTURE_1_SSP(quirk) => quirk is treated as 32 bit width default during shift. also here we are not passing sof_rt5682_quirk as argument.
just passing a integer value ex. SOF_HDMI_CAPTURE_1_SSP(0) . So its irrelevant of sof_rt5682_quirk data type. please confirm.

shift-count-overflow

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bardliao,

As per your suggestion changed the code and uploaded. please check.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CBala21 Thanks, it looks good. Can you split the commit into 3?

  1. Add HDMI_IN SSP support
  2. Add adl_rt5682_c1_h02 id
  3. Add adl_rt5682_rt5682s_hp in snd_soc_acpi_intel_adl_machines[]

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi [bardliao],

All these three changes are connected without this HDMI -in capture use case wont work. Still you want to split it out?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi [bardliao],

All these three changes are connected without this HDMI -in capture use case wont work. Still you want to split it out?

Yes, supporting HDMI -in capture is a new feature and adding board support is another topic though they can not work without each other. What I am not sure is whether adding adl_rt5682_c1_h02 id and adl_rt5682_rt5682s_hp should be in the same commit or not. @plbossart What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's fine to add in the same commit. I'll approve, let's move on with this.

sound/soc/intel/boards/sof_rt5682.c Outdated Show resolved Hide resolved
sound/soc/intel/common/soc-acpi-intel-adl-match.c Outdated Show resolved Hide resolved
sound/soc/intel/common/soc-acpi-intel-adl-match.c Outdated Show resolved Hide resolved
sound/soc/intel/boards/sof_rt5682.c Outdated Show resolved Hide resolved
(((quirk) << SOF_NO_OF_HDMI_CAPTURE_SSP_SHIFT) & SOF_NO_OF_HDMI_CAPTURE_SSP_MASK)

#define SOF_HDMI_CAPTURE_1_SSP_SHIFT 30
#define SOF_HDMI_CAPTURE_1_SSP_MASK (GENMASK(32, 30))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for typecast, use u64 for the quirk.

SOF_HDMI_CAPTURE_1_SSP(0) |
SOF_HDMI_CAPTURE_2_SSP(2) |
SOF_SSP_HDMI_CAPTURE_PRESENT),
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why would you put this last instead of grouping it with the rest of ADL stuff? This is just too messy.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. this messed up happen due to changes brought from 5.15 development kernel into mainline. Actually there is no RPL, MTL support on 5.15 kernel and no entry for other boards and its last entry.
We will correct it and update.

bardliao
bardliao previously approved these changes Jul 12, 2023
Adding support for 2 streams of HDMI-In capture via I2S with rt5682s
codec variant

Signed-off-by: apoorv <[email protected]>
(((quirk) << SOF_NO_OF_HDMI_CAPTURE_SSP_SHIFT) & SOF_NO_OF_HDMI_CAPTURE_SSP_MASK)

#define SOF_HDMI_CAPTURE_1_SSP_SHIFT 30
#define SOF_HDMI_CAPTURE_1_SSP_MASK (GENMASK(32, 30))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's fine to add in the same commit. I'll approve, let's move on with this.

@plbossart
Copy link
Member

test this please

@plbossart plbossart merged commit a4a1def into thesofproject:topic/sof-dev Jul 26, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants