* [PATCH] ASoC: pcm512x: Remove hardcoding of pll-lock to GPIO4
@ 2015-03-23 21:17 Howard Mitchell
[not found] ` <1427145421-5544-1-git-send-email-hm-n6SlHCM0l+K9FHfhHBbuYA@public.gmane.org>
2015-03-24 7:52 ` Peter Rosin
0 siblings, 2 replies; 4+ messages in thread
From: Howard Mitchell @ 2015-03-23 21:17 UTC (permalink / raw)
To: broonie, peda
Cc: tiwai, lgirdwood, perex, robh+dt, pawel.moll, mark.rutland,
ijc+devicetree, galak, devicetree, alsa-devel, linux-kernel,
Howard Mitchell
Currently GPIO4 is hardcoded to output the pll-lock signal.
Unfortunately this is after the pll-out GPIO is configured which
is selectable in the device tree. Therefore it is not possible to
use GPIO4 for pll-out. Therefore this patch removes the
configuration of GPIO4.
Signed-off-by: Howard Mitchell <hm@hmbedded.co.uk>
---
sound/soc/codecs/pcm512x.c | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c
index 8472099..5a30fdd 100644
--- a/sound/soc/codecs/pcm512x.c
+++ b/sound/soc/codecs/pcm512x.c
@@ -1296,25 +1296,6 @@ static int pcm512x_hw_params(struct snd_pcm_substream *substream,
ret, pcm512x->pll_out);
return ret;
}
-
- gpio = PCM512x_G1OE << (4 - 1);
- ret = regmap_update_bits(pcm512x->regmap, PCM512x_GPIO_EN,
- gpio, gpio);
- if (ret != 0) {
- dev_err(codec->dev, "Failed to enable gpio %d: %d\n",
- 4, ret);
- return ret;
- }
-
- gpio = PCM512x_GPIO_OUTPUT_1 + 4 - 1;
- ret = regmap_update_bits(pcm512x->regmap, gpio,
- PCM512x_GxSL, PCM512x_GxSL_PLLLK);
- if (ret != 0) {
- dev_err(codec->dev,
- "Failed to output pll lock on %d: %d\n",
- ret, 4);
- return ret;
- }
}
ret = regmap_update_bits(pcm512x->regmap, PCM512x_SYNCHRONIZE,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread[parent not found: <1427145421-5544-1-git-send-email-hm-n6SlHCM0l+K9FHfhHBbuYA@public.gmane.org>]
* Re: [PATCH] ASoC: pcm512x: Remove hardcoding of pll-lock to GPIO4
[not found] ` <1427145421-5544-1-git-send-email-hm-n6SlHCM0l+K9FHfhHBbuYA@public.gmane.org>
@ 2015-03-23 21:38 ` Mark Brown
0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2015-03-23 21:38 UTC (permalink / raw)
To: Howard Mitchell
Cc: peda-koto5C5qi+TLoDKTGw+V6w, tiwai-l3A5Bk7waGM,
lgirdwood-Re5JQEeQqe8AvxtiuMwx3w, perex-/Fr2/VpizcU,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
galak-sgV2jX0FEOL9JmXXK+q4OQ, devicetree-u79uwXL29TY76Z2rM5mHXA,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 499 bytes --]
On Mon, Mar 23, 2015 at 09:17:01PM +0000, Howard Mitchell wrote:
> Currently GPIO4 is hardcoded to output the pll-lock signal.
> Unfortunately this is after the pll-out GPIO is configured which
> is selectable in the device tree. Therefore it is not possible to
> use GPIO4 for pll-out. Therefore this patch removes the
> configuration of GPIO4.
Applied, thanks. Please pay attention to your CC lists - try to avoid
CC irrelevant people on your mails. This helps cut down on people's
mail loads.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] ASoC: pcm512x: Remove hardcoding of pll-lock to GPIO4
2015-03-23 21:17 [PATCH] ASoC: pcm512x: Remove hardcoding of pll-lock to GPIO4 Howard Mitchell
[not found] ` <1427145421-5544-1-git-send-email-hm-n6SlHCM0l+K9FHfhHBbuYA@public.gmane.org>
@ 2015-03-24 7:52 ` Peter Rosin
2015-03-24 10:10 ` Howard Mitchell
1 sibling, 1 reply; 4+ messages in thread
From: Peter Rosin @ 2015-03-24 7:52 UTC (permalink / raw)
To: Howard Mitchell, broonie@kernel.org
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Howard Mitchell wrote:
> Currently GPIO4 is hardcoded to output the pll-lock signal.
> Unfortunately this is after the pll-out GPIO is configured which
> is selectable in the device tree. Therefore it is not possible to
> use GPIO4 for pll-out. Therefore this patch removes the
> configuration of GPIO4.
Howard, thanks for picking up my laundry!
Is master mode working for you otherwise? Have you seen any sign
of bad dividers for the various clocks, or anything like that?
Regarding the pin configuration, I suppose the cleanest approach
would be to implement it as a pin control driver? Then you could
also expose the pins as gpios and select the pin functions in a more
standard way, right? I wouldn't know where to start with that
though. I have the feeling that it would also mean that there would
have to be a mfd driver for the chip???
However, there is the issue that we don't need anything more from
the chip, so we're happy with the driver as is (assuming the overclocking
patch goes in as planned for 4.1).
Cheers,
Peter
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] ASoC: pcm512x: Remove hardcoding of pll-lock to GPIO4
2015-03-24 7:52 ` Peter Rosin
@ 2015-03-24 10:10 ` Howard Mitchell
0 siblings, 0 replies; 4+ messages in thread
From: Howard Mitchell @ 2015-03-24 10:10 UTC (permalink / raw)
To: Peter Rosin
Cc: alsa-devel@alsa-project.org, broonie@kernel.org,
linux-kernel@vger.kernel.org
On 24/03/15 07:52, Peter Rosin wrote:
> Howard Mitchell wrote:
>> Currently GPIO4 is hardcoded to output the pll-lock signal.
>> Unfortunately this is after the pll-out GPIO is configured which
>> is selectable in the device tree. Therefore it is not possible to
>> use GPIO4 for pll-out. Therefore this patch removes the
>> configuration of GPIO4.
> Howard, thanks for picking up my laundry!
No problem. It was pretty quick and easy to redo from my previous patch
anyway.
> Is master mode working for you otherwise? Have you seen any sign
> of bad dividers for the various clocks, or anything like that?
Not so far. I've run though all the sampling rates from 44.1KHz to
192KHz with a 24.576MHz input clock and they all sounded ok. I haven't
done the maths and checked every single divider setting but I think I
would have heard if something wasn't quite right.
> Regarding the pin configuration, I suppose the cleanest approach
> would be to implement it as a pin control driver? Then you could
> also expose the pins as gpios and select the pin functions in a more
> standard way, right? I wouldn't know where to start with that
> though. I have the feeling that it would also mean that there would
> have to be a mfd driver for the chip???
Yes that would allow userspace access as well. I guess a good place to
start would be one of the I2C gpio expanders:
.../drivers_/_gpio_/_gpio-pca953x.c for instance.
> However, there is the issue that we don't need anything more from
> the chip, so we're happy with the driver as is (assuming the overclocking
> patch goes in as planned for 4.1).
On our board the additional gpios are not even tracked out so the driver
is fine as is for now. For the future we have discussed the possibility
of providing two master clock oscillators to avoid using the pll
altogether. In this case one of the gpios could be used for switching.
- Howard
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-03-24 10:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-23 21:17 [PATCH] ASoC: pcm512x: Remove hardcoding of pll-lock to GPIO4 Howard Mitchell
[not found] ` <1427145421-5544-1-git-send-email-hm-n6SlHCM0l+K9FHfhHBbuYA@public.gmane.org>
2015-03-23 21:38 ` Mark Brown
2015-03-24 7:52 ` Peter Rosin
2015-03-24 10:10 ` Howard Mitchell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox