diff mbox series

ASoC: dt-bindings: maxim,max98357a: Add compatible with richtek,rt9123

Message ID 1884c3ce2d901ead5d742958889f5a742e168376.1742259040.git.cy_huang@richtek.com (mailing list archive)
State New
Headers show
Series ASoC: dt-bindings: maxim,max98357a: Add compatible with richtek,rt9123 | expand

Commit Message

ChiYuan Huang March 18, 2025, 12:57 a.m. UTC
From: ChiYuan Huang <cy_huang@richtek.com>

The hardware control and specification of 'richtek,rt9123' are similar
with max98357 or max98360. It's no need to add the new source code. So
make it compatible with one of them.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
---
 .../devicetree/bindings/sound/maxim,max98357a.yaml    | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Comments

Krzysztof Kozlowski March 18, 2025, 8:55 a.m. UTC | #1
On Tue, Mar 18, 2025 at 08:57:51AM +0800, cy_huang@richtek.com wrote:
> From: ChiYuan Huang <cy_huang@richtek.com>
> 
> The hardware control and specification of 'richtek,rt9123' are similar
> with max98357 or max98360. It's no need to add the new source code. So

Are you sure? I looked at datasheet and do not see anything about
SD_MODE in RT9123. Also you have two supplies, while max98360a has only
one. You have I2C but max98360a has no.

These devices do not look compatible.

Best regards,
Krzysztof
ChiYuan Huang March 18, 2025, 11:26 a.m. UTC | #2
On Tue, Mar 18, 2025 at 09:55:48AM +0100, Krzysztof Kozlowski wrote:
> On Tue, Mar 18, 2025 at 08:57:51AM +0800, cy_huang@richtek.com wrote:
> > From: ChiYuan Huang <cy_huang@richtek.com>
> > 
> > The hardware control and specification of 'richtek,rt9123' are similar
> > with max98357 or max98360. It's no need to add the new source code. So
> 
> Are you sure? I looked at datasheet and do not see anything about
> SD_MODE in RT9123. Also you have two supplies, while max98360a has only
> one. You have I2C but max98360a has no.
> 
Sure, consider the I2C mode. Then it seems different. For the power
supply, yes, we have one more supply and it's used for digital input
output reference. It will always tiled to SoC digital power domain.
It's no need to control, so I think DVDD can be ignored.

If not considering the I2C, and the DVDD power supply, for HW control
mode, then it looks the same including sample rate. One pin to turn on
the amplifier.

This IC is designed for 'easy to use'. For the normal condition, HW mode
will always be suggested to the customer.

May I have your suggestion? If it can not be compatible, should I write
two drivers, one platform driver for HW control mode, and another I2C driver
for I2C SW control mode?

Hope to get your feedback.

Sincerely,
ChiYuan Huang.

> These devices do not look compatible.
> 
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski March 19, 2025, 7:42 a.m. UTC | #3
On 18/03/2025 12:26, ChiYuan Huang wrote:
> On Tue, Mar 18, 2025 at 09:55:48AM +0100, Krzysztof Kozlowski wrote:
>> On Tue, Mar 18, 2025 at 08:57:51AM +0800, cy_huang@richtek.com wrote:
>>> From: ChiYuan Huang <cy_huang@richtek.com>
>>>
>>> The hardware control and specification of 'richtek,rt9123' are similar
>>> with max98357 or max98360. It's no need to add the new source code. So
>>
>> Are you sure? I looked at datasheet and do not see anything about
>> SD_MODE in RT9123. Also you have two supplies, while max98360a has only
>> one. You have I2C but max98360a has no.
>>
> Sure, consider the I2C mode. Then it seems different. For the power
> supply, yes, we have one more supply and it's used for digital input
> output reference. It will always tiled to SoC digital power domain.
> It's no need to control, so I think DVDD can be ignored.
> 
> If not considering the I2C, and the DVDD power supply, for HW control
> mode, then it looks the same including sample rate. One pin to turn on
> the amplifier.
> 
> This IC is designed for 'easy to use'. For the normal condition, HW mode
> will always be suggested to the customer.
> 
> May I have your suggestion? If it can not be compatible, should I write
> two drivers, one platform driver for HW control mode, and another I2C driver
> for I2C SW control mode?


We don't talk about drivers here. I only commented that they are not
compatible based on datasheets, so compatibility should not be expressed
in the DT. Considering I2C, this should be in its own binding with full
device description (so for both HW mode and I2C).

Best regards,
Krzysztof
ChiYuan Huang March 19, 2025, 8:21 a.m. UTC | #4
On Wed, Mar 19, 2025 at 08:42:11AM +0100, Krzysztof Kozlowski wrote:
> On 18/03/2025 12:26, ChiYuan Huang wrote:
> > On Tue, Mar 18, 2025 at 09:55:48AM +0100, Krzysztof Kozlowski wrote:
> >> On Tue, Mar 18, 2025 at 08:57:51AM +0800, cy_huang@richtek.com wrote:
> >>> From: ChiYuan Huang <cy_huang@richtek.com>
> >>>
> >>> The hardware control and specification of 'richtek,rt9123' are similar
> >>> with max98357 or max98360. It's no need to add the new source code. So
> >>
> >> Are you sure? I looked at datasheet and do not see anything about
> >> SD_MODE in RT9123. Also you have two supplies, while max98360a has only
> >> one. You have I2C but max98360a has no.
> >>
> > Sure, consider the I2C mode. Then it seems different. For the power
> > supply, yes, we have one more supply and it's used for digital input
> > output reference. It will always tiled to SoC digital power domain.
> > It's no need to control, so I think DVDD can be ignored.
> > 
> > If not considering the I2C, and the DVDD power supply, for HW control
> > mode, then it looks the same including sample rate. One pin to turn on
> > the amplifier.
> > 
> > This IC is designed for 'easy to use'. For the normal condition, HW mode
> > will always be suggested to the customer.
> > 
> > May I have your suggestion? If it can not be compatible, should I write
> > two drivers, one platform driver for HW control mode, and another I2C driver
> > for I2C SW control mode?
> 
> 
> We don't talk about drivers here. I only commented that they are not
> compatible based on datasheets, so compatibility should not be expressed
> in the DT. Considering I2C, this should be in its own binding with full
> device description (so for both HW mode and I2C).
> 
Actually, These two mode cannot be coexixted. The HW or SW I2C mode is
detected on POR by different external resistor.

Just for the HW mode, all the controls, even sampling rate, supported
bitrate are all similiar with max98357 driver.

That's why I'm trying to treat it to be compatible.

For SW I2C, sure, I can write one for the dedicated usage. Under this
mode, all onoff sequences need to be controlled by RG.

> Best regards,
> Krzysztof
Krzysztof Kozlowski March 19, 2025, 8:36 a.m. UTC | #5
On 19/03/2025 09:21, ChiYuan Huang wrote:
> On Wed, Mar 19, 2025 at 08:42:11AM +0100, Krzysztof Kozlowski wrote:
>> On 18/03/2025 12:26, ChiYuan Huang wrote:
>>> On Tue, Mar 18, 2025 at 09:55:48AM +0100, Krzysztof Kozlowski wrote:
>>>> On Tue, Mar 18, 2025 at 08:57:51AM +0800, cy_huang@richtek.com wrote:
>>>>> From: ChiYuan Huang <cy_huang@richtek.com>
>>>>>
>>>>> The hardware control and specification of 'richtek,rt9123' are similar
>>>>> with max98357 or max98360. It's no need to add the new source code. So
>>>>
>>>> Are you sure? I looked at datasheet and do not see anything about
>>>> SD_MODE in RT9123. Also you have two supplies, while max98360a has only
>>>> one. You have I2C but max98360a has no.
>>>>
>>> Sure, consider the I2C mode. Then it seems different. For the power
>>> supply, yes, we have one more supply and it's used for digital input
>>> output reference. It will always tiled to SoC digital power domain.
>>> It's no need to control, so I think DVDD can be ignored.
>>>
>>> If not considering the I2C, and the DVDD power supply, for HW control
>>> mode, then it looks the same including sample rate. One pin to turn on
>>> the amplifier.
>>>
>>> This IC is designed for 'easy to use'. For the normal condition, HW mode
>>> will always be suggested to the customer.
>>>
>>> May I have your suggestion? If it can not be compatible, should I write
>>> two drivers, one platform driver for HW control mode, and another I2C driver
>>> for I2C SW control mode?
>>
>>
>> We don't talk about drivers here. I only commented that they are not
>> compatible based on datasheets, so compatibility should not be expressed
>> in the DT. Considering I2C, this should be in its own binding with full
>> device description (so for both HW mode and I2C).
>>
> Actually, These two mode cannot be coexixted. 

I did not claim that.

> The HW or SW I2C mode is
> detected on POR by different external resistor.

Not related to binding. Binding describes hardware and the chip does not
magically change its transistors based on external resistor, right?

> 
> Just for the HW mode, all the controls, even sampling rate, supported
> bitrate are all similiar with max98357 driver.
> 
> That's why I'm trying to treat it to be compatible.
> 
> For SW I2C, sure, I can write one for the dedicated usage. Under this
> mode, all onoff sequences need to be controlled by RG.

Did you read my first sentence? We do not talk about drivers. What do
you want to write? Driver?


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/maxim,max98357a.yaml b/Documentation/devicetree/bindings/sound/maxim,max98357a.yaml
index 83ba8666fbb4..5dc7e60b67d6 100644
--- a/Documentation/devicetree/bindings/sound/maxim,max98357a.yaml
+++ b/Documentation/devicetree/bindings/sound/maxim,max98357a.yaml
@@ -18,9 +18,14 @@  allOf:
 
 properties:
   compatible:
-    enum:
-      - maxim,max98357a
-      - maxim,max98360a
+    oneOf:
+      - enum:
+          - maxim,max98357a
+          - maxim,max98360a
+      - items:
+          - enum:
+              - richtek,rt9123
+          - const: maxim,max98360a
 
   '#sound-dai-cells':
     const: 0