From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Nicolas Porcel <nicolasporcel06@gmail.com>,
alsa-devel@alsa-project.org,
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Subject: Re: [PATCH v2] ASoC: Intel: byt-max98090: Add GPIO ACPI mapping table
Date: Mon, 12 Jun 2017 11:54:58 +0300 [thread overview]
Message-ID: <1497257698.22624.121.camel@linux.intel.com> (raw)
In-Reply-To: <20170610163741.49214-1-andriy.shevchenko@linux.intel.com>
On Sat, 2017-06-10 at 19:37 +0300, Andy Shevchenko wrote:
> In order to make GPIO ACPI library stricter prepare users of
> gpiod_get_index() to correctly behave when there no mapping is
> provided by firmware.
>
> Here we add explicit mapping between _CRS GpioIo() resources and
> their names used in the driver.
>
Mark, we agreed with Takashi that the patch is okay in its initial form.
Should I resend it, or maybe you can take it from this thread?
> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Tested-by: Nicolas Porcel <nicolasporcel06@gmail.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> - update device node to which the mapping table is attached
> - remove idx assignment to 0 (it's by default)
> - add Nicolas' tag (sent privately)
> sound/soc/intel/boards/byt-max98090.c | 24 ++++++++++++++++++------
> 1 file changed, 18 insertions(+), 6 deletions(-)
>
> diff --git a/sound/soc/intel/boards/byt-max98090.c
> b/sound/soc/intel/boards/byt-max98090.c
> index d9f81b8d915d..047be7fa0ce9 100644
> --- a/sound/soc/intel/boards/byt-max98090.c
> +++ b/sound/soc/intel/boards/byt-max98090.c
> @@ -67,20 +67,27 @@ static struct snd_soc_jack_pin hs_jack_pins[] = {
>
> static struct snd_soc_jack_gpio hs_jack_gpios[] = {
> {
> - .name = "hp-gpio",
> - .idx = 0,
> + .name = "hp",
> .report = SND_JACK_HEADPHONE |
> SND_JACK_LINEOUT,
> .debounce_time = 200,
> },
> {
> - .name = "mic-gpio",
> - .idx = 1,
> + .name = "mic",
> .invert = 1,
> .report = SND_JACK_MICROPHONE,
> .debounce_time = 200,
> },
> };
>
> +static const struct acpi_gpio_params hp_gpios = { 0, 0, false };
> +static const struct acpi_gpio_params mic_gpios = { 1, 0, false };
> +
> +static const struct acpi_gpio_mapping acpi_byt_max98090_gpios[] = {
> + { "hp-gpios", &hp_gpios, 1 },
> + { "mic-gpios", &mic_gpios, 1 },
> + {},
> +};
> +
> static int byt_max98090_init(struct snd_soc_pcm_runtime *runtime)
> {
> int ret;
> @@ -140,8 +147,9 @@ static struct snd_soc_card byt_max98090_card = {
>
> static int byt_max98090_probe(struct platform_device *pdev)
> {
> - int ret_val = 0;
> + struct device *dev = &pdev->dev;
> struct byt_max98090_private *priv;
> + int ret_val;
>
> priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_ATOMIC);
> if (!priv) {
> @@ -149,6 +157,10 @@ static int byt_max98090_probe(struct
> platform_device *pdev)
> return -ENOMEM;
> }
>
> + ret_val = devm_acpi_dev_add_driver_gpios(dev->parent,
> acpi_byt_max98090_gpios);
> + if (ret_val)
> + dev_dbg(dev, "Unable to add GPIO mapping table\n");
> +
> byt_max98090_card.dev = &pdev->dev;
> snd_soc_card_set_drvdata(&byt_max98090_card, priv);
> ret_val = devm_snd_soc_register_card(&pdev->dev,
> &byt_max98090_card);
> @@ -158,7 +170,7 @@ static int byt_max98090_probe(struct
> platform_device *pdev)
> return ret_val;
> }
>
> - return ret_val;
> + return 0;
> }
>
> static int byt_max98090_remove(struct platform_device *pdev)
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2017-06-12 8:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-10 16:37 [PATCH v2] ASoC: Intel: byt-max98090: Add GPIO ACPI mapping table Andy Shevchenko
2017-06-10 19:41 ` Takashi Iwai
2017-06-11 14:01 ` Andy Shevchenko
2017-06-11 16:48 ` Takashi Iwai
2017-06-11 17:02 ` Andy Shevchenko
2017-06-11 17:08 ` Takashi Iwai
2017-06-11 17:18 ` Andy Shevchenko
2017-06-12 8:54 ` Andy Shevchenko [this message]
2017-06-13 21:08 ` Applied "ASoC: Intel: byt-max98090: Add GPIO ACPI mapping table" to the asoc tree Mark Brown
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=1497257698.22624.121.camel@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=nicolasporcel06@gmail.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).