[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9591999e-9d7f-2a4a-29df-d9c42dfa736b@linaro.org>
Date: Fri, 12 May 2023 17:30:37 +0200
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Charles Keepax <ckeepax@...nsource.cirrus.com>, broonie@...nel.org,
lee@...nel.org, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
tglx@...utronix.de, maz@...nel.org, linus.walleij@...aro.org,
vkoul@...nel.org
Cc: lgirdwood@...il.com, yung-chuan.liao@...ux.intel.com,
sanyog.r.kale@...el.com, pierre-louis.bossart@...ux.intel.com,
alsa-devel@...a-project.org, patches@...nsource.cirrus.com,
devicetree@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 08/10] pinctrl: cs42l43: Add support for the cs42l43
On 12/05/2023 14:28, Charles Keepax wrote:
> The CS42L43 is an audio CODEC with integrated MIPI SoundWire interface
> (Version 1.2.1 compliant), I2C, SPI, and I2S/TDM interfaces designed
> for portable applications. It provides a high dynamic range, stereo
> DAC for headphone output, two integrated Class D amplifiers for
> loudspeakers, and two ADCs for wired headset microphone input or
> stereo line input. PDM inputs are provided for digital microphones.
>
> Add a basic pinctrl driver which supports driver strength for the
> various pins, gpios, and pinmux for the 2 multi-function pins.
>
> Signed-off-by: Charles Keepax <ckeepax@...nsource.cirrus.com>
...
> +{
> + struct cs42l43 *cs42l43 = dev_get_drvdata(pdev->dev.parent);
> + struct cs42l43_pin *priv;
> + struct pinctrl_dev *pctldev;
> + int ret;
> +
> + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
> + if (!priv)
> + return -ENOMEM;
> +
> + priv->dev = &pdev->dev;
> + priv->regmap = cs42l43->regmap;
> +
> + priv->shutters_locked = cs42l43->hw_lock;
> +
> + priv->gpio_chip.request = gpiochip_generic_request;
> + priv->gpio_chip.free = gpiochip_generic_free;
> + priv->gpio_chip.direction_input = cs42l43_gpio_direction_in;
> + priv->gpio_chip.direction_output = cs42l43_gpio_direction_out;
> + priv->gpio_chip.get = cs42l43_gpio_get;
> + priv->gpio_chip.set = cs42l43_gpio_set;
> + priv->gpio_chip.label = dev_name(priv->dev);
> + priv->gpio_chip.parent = priv->dev;
> + priv->gpio_chip.can_sleep = true;
> + priv->gpio_chip.base = -1;
> + priv->gpio_chip.ngpio = CS42L43_NUM_GPIOS;
> + priv->gpio_chip.fwnode = dev_fwnode(cs42l43->dev);
> +
> + if (is_of_node(dev_fwnode(cs42l43->dev))) {
> + device_set_node(priv->dev,
> + fwnode_get_named_child_node(dev_fwnode(cs42l43->dev),
> + "pinctrl"));
That's something unusual. It seems you want to bind to a DT node because
you miss compatible in DT node?
> + } else {
> + device_set_node(priv->dev, dev_fwnode(cs42l43->dev));
> + }
> +
> + pm_runtime_enable(priv->dev);
> + pm_runtime_idle(priv->dev);
> +
....
> +
> +static struct platform_driver cs42l43_pin_driver = {
> + .driver = {
> + .name = "cs42l43-pinctrl",
> + },
> +
> + .probe = cs42l43_pin_probe,
> + .remove = cs42l43_pin_remove,
> +};
> +module_platform_driver(cs42l43_pin_driver);
> +
> +MODULE_DESCRIPTION("CS42L43 Pinctrl Driver");
> +MODULE_AUTHOR("Charles Keepax <ckeepax@...nsource.cirrus.com>");
> +MODULE_LICENSE("GPL");
> +MODULE_ALIAS("platform:cs42l43-pinctrl");
Same comment, so I guess you have this pattern everywhere.
Best regards,
Krzysztof
Powered by blists - more mailing lists