From: Sylwester Nawrocki <s.nawrocki@samsung.com> To: broonie@kernel.org Cc: krzk@kernel.org, alsa-devel@alsa-project.org, b.zolnierkie@samsung.com, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sylwester Nawrocki <s.nawrocki@samsung.com> Subject: [PATCH 3/8] ASoC: uda134x: Optionally initialize L3 ops to default GPIO ops Date: Thu, 04 Aug 2016 15:38:43 +0200 [thread overview] Message-ID: <1470317928-25365-4-git-send-email-s.nawrocki@samsung.com> (raw) In-Reply-To: <1470317928-25365-1-git-send-email-s.nawrocki@samsung.com> The GPIO ops can be selected by platform_data which allows the codec platform device to probe without the sound card's driver intervention. The downside is that it will request GPIOs on behalf of the codec device and thus allow only one user on the bus, but it desn't seem to be a limitation with current code and usage of the GPIO ops is optional anyway. The proper approach would presumably be to create a proper Linux bus driver for L3, should this rather ancient bus specification suddenly gain more interest. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> --- sound/soc/codecs/uda134x.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c index e4c694c..b72c925 100644 --- a/sound/soc/codecs/uda134x.c +++ b/sound/soc/codecs/uda134x.c @@ -544,6 +544,7 @@ static int uda134x_codec_probe(struct platform_device *pdev) { struct uda134x_platform_data *pd = pdev->dev.platform_data; struct uda134x_priv *uda134x; + int ret; if (!pd) { dev_err(&pdev->dev, "Missing L3 bitbang function\n"); @@ -557,6 +558,12 @@ static int uda134x_codec_probe(struct platform_device *pdev) uda134x->pd = pd; platform_set_drvdata(pdev, uda134x); + if (pd->l3.use_gpios) { + ret = l3_set_gpio_ops(&pdev->dev, &uda134x->pd->l3); + if (ret < 0) + return ret; + } + uda134x->regmap = devm_regmap_init(&pdev->dev, NULL, pd, &uda134x_regmap_config); if (IS_ERR(uda134x->regmap)) -- 1.9.1
WARNING: multiple messages have this Message-ID (diff)
From: s.nawrocki@samsung.com (Sylwester Nawrocki) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/8] ASoC: uda134x: Optionally initialize L3 ops to default GPIO ops Date: Thu, 04 Aug 2016 15:38:43 +0200 [thread overview] Message-ID: <1470317928-25365-4-git-send-email-s.nawrocki@samsung.com> (raw) In-Reply-To: <1470317928-25365-1-git-send-email-s.nawrocki@samsung.com> The GPIO ops can be selected by platform_data which allows the codec platform device to probe without the sound card's driver intervention. The downside is that it will request GPIOs on behalf of the codec device and thus allow only one user on the bus, but it desn't seem to be a limitation with current code and usage of the GPIO ops is optional anyway. The proper approach would presumably be to create a proper Linux bus driver for L3, should this rather ancient bus specification suddenly gain more interest. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> --- sound/soc/codecs/uda134x.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c index e4c694c..b72c925 100644 --- a/sound/soc/codecs/uda134x.c +++ b/sound/soc/codecs/uda134x.c @@ -544,6 +544,7 @@ static int uda134x_codec_probe(struct platform_device *pdev) { struct uda134x_platform_data *pd = pdev->dev.platform_data; struct uda134x_priv *uda134x; + int ret; if (!pd) { dev_err(&pdev->dev, "Missing L3 bitbang function\n"); @@ -557,6 +558,12 @@ static int uda134x_codec_probe(struct platform_device *pdev) uda134x->pd = pd; platform_set_drvdata(pdev, uda134x); + if (pd->l3.use_gpios) { + ret = l3_set_gpio_ops(&pdev->dev, &uda134x->pd->l3); + if (ret < 0) + return ret; + } + uda134x->regmap = devm_regmap_init(&pdev->dev, NULL, pd, &uda134x_regmap_config); if (IS_ERR(uda134x->regmap)) -- 1.9.1
next prev parent reply other threads:[~2016-08-04 13:40 UTC|newest] Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-08-04 13:38 [PATCH 0/8] ASoC: s3c24xx_uda134x card fixes and cleanups Sylwester Nawrocki 2016-08-04 13:38 ` Sylwester Nawrocki 2016-08-04 13:38 ` [PATCH 1/8] ASoC: L3 bus: Add default gpio ops Sylwester Nawrocki 2016-08-04 13:38 ` Sylwester Nawrocki 2016-08-04 13:38 ` [PATCH 2/8] ARM: S3C24XX: Specify audio codec platform_data for mini2440 board Sylwester Nawrocki 2016-08-04 13:38 ` Sylwester Nawrocki 2016-08-04 13:38 ` Sylwester Nawrocki [this message] 2016-08-04 13:38 ` [PATCH 3/8] ASoC: uda134x: Optionally initialize L3 ops to default GPIO ops Sylwester Nawrocki 2016-08-04 21:03 ` Mark Brown 2016-08-04 21:03 ` Mark Brown 2016-08-05 8:48 ` Sylwester Nawrocki 2016-08-05 8:48 ` Sylwester Nawrocki 2016-08-04 13:38 ` [PATCH 4/8] ASoC: s3c24xx_uda134x: Remove unused power() callback Sylwester Nawrocki 2016-08-04 13:38 ` Sylwester Nawrocki 2016-08-04 13:38 ` [PATCH 5/8] ASoC: s3c24xx_uda134x: Drop initialization of codec's platform data Sylwester Nawrocki 2016-08-04 13:38 ` Sylwester Nawrocki 2016-08-04 13:38 ` [PATCH 6/8] ASoC: samsung: Convert s3c24xx_uda134x to use devm_snd_soc_register_card() Sylwester Nawrocki 2016-08-04 13:38 ` Sylwester Nawrocki 2016-08-04 13:38 ` [PATCH 7/8] ASoC: samsung: s3c24xx_uda134x: debug/error trace cleanup Sylwester Nawrocki 2016-08-04 13:38 ` Sylwester Nawrocki 2016-08-04 21:05 ` Mark Brown 2016-08-04 21:05 ` Mark Brown 2016-08-05 9:52 ` Sylwester Nawrocki 2016-08-05 9:52 ` Sylwester Nawrocki 2016-08-04 13:38 ` [PATCH 8/8] ASoC: s3c244_uda134x: Allocate private data dynamically Sylwester Nawrocki 2016-08-04 13:38 ` Sylwester Nawrocki 2016-10-25 19:24 ` Applied "ASoC: s3c24xx_uda134x: Move global variables to driver's data structure" to the asoc tree Mark Brown 2016-10-25 19:24 ` 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=1470317928-25365-4-git-send-email-s.nawrocki@samsung.com \ --to=s.nawrocki@samsung.com \ --cc=alsa-devel@alsa-project.org \ --cc=b.zolnierkie@samsung.com \ --cc=broonie@kernel.org \ --cc=krzk@kernel.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-samsung-soc@vger.kernel.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.