devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oder Chiou <oder_chiou@realtek.com>
To: "'Rob Herring'" <robh@kernel.org>
Cc: "cezary.rojewski@intel.com" <cezary.rojewski@intel.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"perex@perex.cz" <perex@perex.cz>,
	"linux-sound@vger.kernel.org" <linux-sound@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"Flove(HsinFu)" <flove@realtek.com>,
	"Shuming [范書銘]" <shumingf@realtek.com>,
	"Jack Yu" <jack.yu@realtek.com>,
	"Derek [方德義]" <derek.fang@realtek.com>
Subject: RE: [PATCH v9 1/2] ASoC: dt-bindings: realtek,rt5575: add support for ALC5575
Date: Fri, 12 Dec 2025 08:59:10 +0000	[thread overview]
Message-ID: <6c85fd92dc244789a5259ff4b11ec2e0@realtek.com> (raw)
In-Reply-To: <20251211153835.GA1251928-robh@kernel.org>

> -----Original Message-----
> From: Rob Herring <robh@kernel.org>
> Sent: Thursday, December 11, 2025 11:39 PM
> To: Oder Chiou <oder_chiou@realtek.com>
> Cc: cezary.rojewski@intel.com; broonie@kernel.org; lgirdwood@gmail.com;
> krzk+dt@kernel.org; conor+dt@kernel.org; perex@perex.cz;
> linux-sound@vger.kernel.org; devicetree@vger.kernel.org;
> alsa-devel@alsa-project.org; Flove(HsinFu) <flove@realtek.com>; Shuming [范
> 書銘] <shumingf@realtek.com>; Jack Yu <jack.yu@realtek.com>; Derek [方德
> 義] <derek.fang@realtek.com>
> Subject: Re: [PATCH v9 1/2] ASoC: dt-bindings: realtek,rt5575: add support for
> ALC5575
> 
> 
> External mail : This email originated from outside the organization. Do not
> reply, click links, or open attachments unless you recognize the sender and
> know the content is safe.
> 
> 
> 
> On Thu, Dec 11, 2025 at 07:01:29PM +0800, Oder Chiou wrote:
> > Audio codec with I2S, I2C and SPI.
> >
> > Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
> > ---
> >  .../bindings/sound/realtek,rt5575.yaml        | 44
> +++++++++++++++++++
> >  1 file changed, 44 insertions(+)
> >  create mode 100644
> Documentation/devicetree/bindings/sound/realtek,rt5575.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/sound/realtek,rt5575.yaml
> b/Documentation/devicetree/bindings/sound/realtek,rt5575.yaml
> > new file mode 100644
> > index 000000000000..60f9af399dd2
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/sound/realtek,rt5575.yaml
> > @@ -0,0 +1,44 @@
> > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/sound/realtek,rt5575.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: ALC5575 audio CODEC
> > +
> > +maintainers:
> > +  - Oder Chiou <oder_chiou@realtek.com>
> > +
> > +description:
> > +  The device supports both I2C and SPI. I2C is mandatory, while SPI is
> > +  optional depending on the hardware configuration.
> > +
> > +allOf:
> > +  - $ref: /schemas/spi/spi-peripheral-props.yaml#
> > +  - $ref: dai-common.yaml#
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - realtek,rt5575
> > +      - realtek,rt5575-use-spi
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> > +unevaluatedProperties: false
> > +
> > +examples:
> > +  - |
> > +    i2c {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +        codec@57 {
> > +            compatible = "realtek,rt5575";
> > +            reg = <0x57>;
> > +        };
> > +    };
> 
> It is completely unclear what you are doing in the SPI case. I
> deciphered it studying the driver. I shouldn't have to do that, your
> binding should make that clear.
> 
> So your DT must look like this:
> 
> i2c {
>         codec@57 {
>                 compatible = "realtek,rt5575-use-spi";
>                 reg = <0x57>;
>         };
> };
> 
> spi {
>         codec@1 {
>                 compatible = "realtek,rt5575";
>                 reg = <0x1>;
>         };
> };
> 
> First, there's no need for "-use-spi" because you can just check if
> there is a rt5575 SPI device and use it if there is. Why would you have
> the SPI device and not use it?

The compatible realtek,rt5575-use-spi will be removed, and if there is no
SPI device in the DTS, the warning message will be shown as "The hardware
configuration should be with built-in flash".

> But really it is not ideal having 2 device nodes for a single device. It
> would be much simpler to just have something like this in the i2c node:
> 
> spi-parent = <&spi0 1>;
> 
> Where the cell is the chip-select #.
> 
> We have an 'i2c-parent' already for similar reasons when there are 2
> bus connections.

In the current kernel, I cannot find any function to obtain a
struct spi_controller when no SPI device is defined in the DTS. This was
possible in older kernels using the legacy spi_busnum_to_master(), but
that function is no longer available in upstream.

Thanks,
Oder

  reply	other threads:[~2025-12-12  8:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-11 11:01 [PATCH v9 0/2] ASoC: rt5575: Add the codec driver for the ALC5575 Oder Chiou
2025-12-11 11:01 ` [PATCH v9 1/2] ASoC: dt-bindings: realtek,rt5575: add support for ALC5575 Oder Chiou
2025-12-11 15:38   ` Rob Herring
2025-12-12  8:59     ` Oder Chiou [this message]
2025-12-12 13:09       ` Rob Herring
2025-12-11 11:01 ` [PATCH v9 2/2] ASoC: rt5575: Add the codec driver for the ALC5575 Oder Chiou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6c85fd92dc244789a5259ff4b11ec2e0@realtek.com \
    --to=oder_chiou@realtek.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=conor+dt@kernel.org \
    --cc=derek.fang@realtek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=flove@realtek.com \
    --cc=jack.yu@realtek.com \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=shumingf@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).