Re: [PATCH 7/7] ASoC: codec: tpa6130a2: Convert to GPIO descriptors

From: Linus Walleij
Date: Tue Apr 15 2025 - 09:31:32 EST


On Tue, Apr 8, 2025 at 3:41 AM Peng Fan (OSS) <peng.fan@xxxxxxxxxxx> wrote:

> From: Peng Fan <peng.fan@xxxxxxx>
>
> of_gpio.h is deprecated, update the driver to use GPIO descriptors.
> - Use devm_gpiod_get_optional to get GPIO descriptor with default
> polarity GPIOD_OUT_LOW, set consumer name.
> - Use gpiod_set_value to configure output value.
>
> While at here
> - reorder the included headers.
> - Drop sound/tpa6130a2-plat.h because no user is creating the device using
> platform data
>
> Checking the DTS polarity, all users are using GPIOD_ACTIVE_HIGH.
> so all should work as expected with this patch.
>
> Cc: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
> Signed-off-by: Peng Fan <peng.fan@xxxxxxx>

(...)
> -static const struct i2c_device_id tpa6130a2_id[] = {
> - { "tpa6130a2", TPA6130A2 },
> - { "tpa6140a2", TPA6140A2 },
> - { }
> -};
> -MODULE_DEVICE_TABLE(i2c, tpa6130a2_id);
(...)
> },
> .probe = tpa6130a2_probe,
> - .id_table = tpa6130a2_id,

IIRC the DT-only I2C drivers still require this ID table,
unintuitive, but I think that's how it is.

(Others may correct me!)

Yours,
Linus Walleij