Skip to content

Conversation

advdarren
Copy link

Add a new patch to enable Advantech QCM6490 ASoC machine driver in the Qualcomm kernel. This patch integrates the driver configuration into the kernel build to support audio on Advantech QCM6490-based platforms.

Changes:

  • Add 0001-ASoC-qcom-add-Advantech-QCM6490-machine-driver-suppo.patch
  • Update linux-qcom-custom_%.bbappend to include the new patch

Add a new patch to enable Advantech QCM6490 ASoC machine driver in
the Qualcomm kernel. This patch integrates the driver configuration
into the kernel build to support audio on Advantech QCM6490-based
platforms.

Changes:
- Add 0001-ASoC-qcom-add-Advantech-QCM6490-machine-driver-suppo.patch
- Update linux-qcom-custom_%.bbappend to include the new patch

Signed-off-by: Darren Huang <[email protected]>
@ndechesne
Copy link

thanks for the patch! I believe this is the first patch to enable a 3rd party hardware, congrats :)

I am expecting some more changes in order to move forward with this patch:

  1. You need to define a proper 'machine' for your board. Without a dedicated machine, I am assuming you are reusing an existing machine from meta-qcom (rb3 gen2 most likely), this is not what we expect. Instead you should create a machine .conf file and use that for your build. Once your machine is defined, you will be able to configure it to match your exact board, set the device tree, ...
  2. The kernel patch you apply is most likely only applicable to your machine. You should only apply the patch when building for your machine. We expect to have several boards supported in the same layer, so we need to make sure each one does not step onto each other

@ricardosalveti
Copy link
Collaborator

@advdarren thanks for the submission, can you provide us a bit more details about this target? As Nico said, the best way forward will be to create a new machine configuration that describes your target, so we can isolate the changes to it, and avoid causing side effects on the other targets available.

+ {.compatible = "adv,qcs6490-rb3gen2-ia-sndcard", .data = &qcs6490_rb3gen2_ia_data},
+ {.compatible = "adv,qcs6490-rb3gen2-ptz-sndcard", .data = &qcs6490_rb3gen2_ptz_data},
+ {.compatible = "adv,qcs6490-rb3gen2-video-sndcard", .data = &qcs6490_rb3gen2_video_data},
+ {.compatible = "adv,qcs6490-rb3gen2-vision-sndcard", .data = &qcs6490_rb3gen2_vision_data},
Copy link

Choose a reason for hiding this comment

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

These comat strings define Advantech RB3 Gen2, which is probably not what you've intended. Could you possibly describe, why you are adding new driver instead of extending an existing one?

Choose a reason for hiding this comment

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

The driver is machine driver which is board specific, which need customization based the board design. Qualcomm machine driver (QCM6490.c) would not merge any customization from OEM/ODM that why customer need to create their own machine driver and do whatever customization they needed.

@advdarren
Copy link
Author

Hi @ndechesne and @ricardosalveti,

Thanks for your feedback!

I have added a dedicated machine configuration for our Advantech QCS6490 board (meta-advantech/conf/machine/qcs6490mio5355a1.conf) and updated the kernel recipe to only apply the 0001-ASoC-qcom-add-Advantech-QCM6490-machine-driver-suppo.patch when MACHINE = qcs6490mio5355a1.

This should isolate the changes to our hardware and avoid impacting existing QCM6490-based boards (such as RB3 Gen2).

For the new recipes-kernel/linux/linux-qcom-custom_%.bbappend as the following:

FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"

SRC_URI:append:qcs6490mio5355a1 = "
file://0001-ASoC-qcom-add-Advantech-QCM6490-machine-driver-suppo.patch
"

Is this correction appropriate? Thanks.

@advdarren
Copy link
Author

Hi @lumag,

Thanks for your feedback!

Since the audio codec used on our board is not supported by the original RB3Gen2 audio machine driver, we have implemented our own audio machine driver to enable Canonical to integrate it into their Git repository.
Thanks.

@ndechesne
Copy link

FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"

The overall approach looks good. I think it's slightly better if you use ${THISDIR}/ for the folder with the patches. Or at least THISDIR/ so that you get your own namespace for patches that apply to your platforms only.

@lumag
Copy link

lumag commented Oct 15, 2025

Since the audio codec used on our board is not supported by the original RB3Gen2 audio machine driver, we have implemented our own audio machine driver to enable Canonical to integrate it into their Git repository. Thanks.

I think you have too many compat strings there. Most likely you don't actually need all of them.
Also I'd strongly suggest patching sc8280xp.c instead. I see that your changes fall into two main classes: Slimbus support and Jack support. Both are present in sdm845.c, so it should be fine to add them to sc8280xp.c too.

@ricardosalveti
Copy link
Collaborator

Hi @ndechesne and @ricardosalveti,

Thanks for your feedback!

I have added a dedicated machine configuration for our Advantech QCS6490 board (meta-advantech/conf/machine/qcs6490mio5355a1.conf) and updated the kernel recipe to only apply the 0001-ASoC-qcom-add-Advantech-QCM6490-machine-driver-suppo.patch when MACHINE = qcs6490mio5355a1.

This should isolate the changes to our hardware and avoid impacting existing QCM6490-based boards (such as RB3 Gen2).

Are you planning on sending the machine configuration as a patch to be included as part of this layer? This would be ideal to get a wider reach (your own layer could depend on this one), but we will also request other pieces to be made available as well (e.g. boot firmware, etc).

@mantishsiang
Copy link

can not patch any existing machine driver which may break RB3G2 functionality because there is customization for OEM/ODM board. hence need to create new.

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