From: rmallon@gmail.com (Ryan Mallon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 06/11] ep93xx: Don't use system controller defines in audio drivers
Date: Sat, 14 Jan 2012 08:41:11 +1100 [thread overview]
Message-ID: <4F10A4F7.60503@gmail.com> (raw)
In-Reply-To: <ADE657CA350FB648AAC2C43247A983F001F3F99EBB04@AUSP01VMBX24.collaborationhost.net>
On 14/01/12 04:35, H Hartley Sweeten wrote:
> On Tuesday, January 10, 2012 8:15 PM, Ryan Mallon wrote:
>> Both the Snapper CL15 and EDB93xx audio drivers set the same
>> audio configuration in ep93xx_i2s_acquire. Remove the arguments
>> to ep93xx_i2s_acquire so that the audio drivers no longer need
>> the EP93XX_SYSCON defines exported.
>>
>> Cc: Hartley Sweeten <hsweeten@visionengravers.com>
>> Cc: Mika Westerberg <mika.westerberg@iki.fi>
>> Cc: Liam Girdwood <lrg@ti.com>
>> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
>> Signed-off-by: Ryan Mallon <rmallon@gmail.com>
>> ---
>> arch/arm/mach-ep93xx/core.c | 19 ++++---------------
>> arch/arm/mach-ep93xx/include/mach/platform.h | 2 +-
>> sound/soc/ep93xx/edb93xx.c | 4 +---
>> sound/soc/ep93xx/snappercl15.c | 4 +---
>> 4 files changed, 7 insertions(+), 22 deletions(-)
>>
>> diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index bd59696..0726b7b 100644
>> --- a/arch/arm/mach-ep93xx/core.c
>> +++ b/arch/arm/mach-ep93xx/core.c
>> @@ -836,23 +836,12 @@ void __init ep93xx_register_i2s(void)
>> #define EP93XX_I2SCLKDIV_MASK (EP93XX_SYSCON_I2SCLKDIV_ORIDE | \
>> EP93XX_SYSCON_I2SCLKDIV_SPOL)
>>
>> -int ep93xx_i2s_acquire(unsigned i2s_pins, unsigned i2s_config)
>> +int ep93xx_i2s_acquire(void)
>> {
>> unsigned val;
>>
>> - /* Sanity check */
>> - if (i2s_pins & ~EP93XX_SYSCON_DEVCFG_I2S_MASK)
>> - return -EINVAL;
>> - if (i2s_config & ~EP93XX_I2SCLKDIV_MASK)
>> - return -EINVAL;
>> -
>> - /* Must have only one of I2SONSSP/I2SONAC97 set */
>> - if ((i2s_pins & EP93XX_SYSCON_DEVCFG_I2SONSSP) ==
>> - (i2s_pins & EP93XX_SYSCON_DEVCFG_I2SONAC97))
>> - return -EINVAL;
>> -
>> - ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_I2S_MASK);
>> - ep93xx_devcfg_set_bits(i2s_pins);
>> + ep93xx_devcfg_set_clear(EP93XX_SYSCON_DEVCFG_I2SONAC97,
>> + EP93XX_SYSCON_DEVCFG_I2S_MASK);
>>
>> /*
>> * This is potentially racy with the clock api for i2s_mclk, sclk and @@ -862,7 +851,7 @@ int ep93xx_i2s_acquire(unsigned i2s_pins, unsigned i2s_config)
>> */
>> val = __raw_readl(EP93XX_SYSCON_I2SCLKDIV);
>> val &= ~EP93XX_I2SCLKDIV_MASK;
>> - val |= i2s_config;
>> + val |= EP93XX_SYSCON_I2SCLKDIV_ORIDE | EP93XX_SYSCON_I2SCLKDIV_SPOL;
>> ep93xx_syscon_swlocked_write(val, EP93XX_SYSCON_I2SCLKDIV);
> Nitpick... You clear then set the same bits here.
I think that is probably a good idea anyway, since if someone copy and
pastes this function to make one for other types of audio devices then
they are more likely to get it right :-).
>> diff --git a/sound/soc/ep93xx/edb93xx.c b/sound/soc/ep93xx/edb93xx.c index 51930b6..3a6ab05 100644
>> --- a/sound/soc/ep93xx/edb93xx.c
>> +++ b/sound/soc/ep93xx/edb93xx.c
>> @@ -94,9 +94,7 @@ static int __devinit edb93xx_probe(struct platform_device *pdev)
>> struct snd_soc_card *card = &snd_soc_edb93xx;
>> int ret;
>>
>> - ret = ep93xx_i2s_acquire(EP93XX_SYSCON_DEVCFG_I2SONAC97,
>> - EP93XX_SYSCON_I2SCLKDIV_ORIDE |
>> - EP93XX_SYSCON_I2SCLKDIV_SPOL);
>> + ret = ep93xx_i2s_acquire();
>> if (ret)
>> return ret;
>>
>> diff --git a/sound/soc/ep93xx/snappercl15.c b/sound/soc/ep93xx/snappercl15.c index 2cde433..6ccac5a 100644
>> --- a/sound/soc/ep93xx/snappercl15.c
>> +++ b/sound/soc/ep93xx/snappercl15.c
>> @@ -110,9 +110,7 @@ static int __devinit snappercl15_probe(struct platform_device *pdev)
>> struct snd_soc_card *card = &snd_soc_snappercl15;
>> int ret;
>>
>> - ret = ep93xx_i2s_acquire(EP93XX_SYSCON_DEVCFG_I2SONAC97,
>> - EP93XX_SYSCON_I2SCLKDIV_ORIDE |
>> - EP93XX_SYSCON_I2SCLKDIV_SPOL);
>> + ret = ep93xx_i2s_acquire();
>> if (ret)
>> return ret;
>>
> Maybe the ep93xx_i2s_acquire() function should be renamed to something
> like ep93xx_i2s_ac97_acquire() so that the i2s configuration is understood.
> This should address Mark Brown's issue.
Mark has already picked this patch up. I can probably modify it and get
him to grab the new one, but the reason I didn't change the name is
because there have been only two users of this function for a couple of
years now, and the ep93xx is obsolete, so its unlikely that we are going
to need a new function anyway.
> Regardless, looks good.
>
> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
>
Thanks,
~Ryan
next prev parent reply other threads:[~2012-01-13 21:41 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-11 3:14 [PATCH 00/11] ep93xx: Move SoC private bits to core Ryan Mallon
2012-01-11 3:14 ` [PATCH 01/11] ep93xx: Move PHYS_BASE defines to local SoC header file Ryan Mallon
2012-01-13 17:18 ` H Hartley Sweeten
2012-01-13 21:35 ` Ryan Mallon
2012-01-11 3:14 ` [PATCH 02/11] ep93xx: Move GPIO defines to gpio-ep93xx.h Ryan Mallon
2012-01-13 17:22 ` H Hartley Sweeten
2012-01-11 3:14 ` [PATCH 03/11] ep93xx: Move peripheral defines to local SoC header Ryan Mallon
2012-01-13 17:25 ` H Hartley Sweeten
2012-01-11 3:14 ` [PATCH 04/11] ep93xx: Configure GPIO ports in core code Ryan Mallon
2012-01-13 6:27 ` Mika Westerberg
2012-01-13 7:00 ` Ryan Mallon
2012-01-13 8:12 ` Mika Westerberg
2012-01-13 18:05 ` H Hartley Sweeten
2012-01-11 3:14 ` [PATCH 05/11] ep93xx: Move arch_reset to core.c Ryan Mallon
2012-01-13 17:28 ` H Hartley Sweeten
2012-01-11 3:14 ` [PATCH 06/11] ep93xx: Don't use system controller defines in audio drivers Ryan Mallon
2012-01-11 17:42 ` Mark Brown
2012-01-11 19:57 ` Ryan Mallon
2012-01-12 3:04 ` Mark Brown
2012-01-13 17:35 ` H Hartley Sweeten
2012-01-13 21:41 ` Ryan Mallon [this message]
2012-01-13 22:13 ` Mark Brown
2012-01-11 3:14 ` [PATCH 07/11] ep93xx: Make syscon access functions private to SoC Ryan Mallon
2012-01-13 17:38 ` H Hartley Sweeten
2012-01-13 21:43 ` Ryan Mallon
2012-01-11 3:14 ` [PATCH 08/11] ep93xx: Move EP93XX_WATCHDOG_BASE define to driver Ryan Mallon
2012-01-13 17:45 ` H Hartley Sweeten
2012-01-13 21:46 ` Ryan Mallon
2012-01-13 22:48 ` H Hartley Sweeten
2012-01-11 3:14 ` [PATCH 09/11] ep93xx: Move crunch code to mach-ep93xx directory Ryan Mallon
2012-01-13 17:51 ` H Hartley Sweeten
2012-01-13 21:16 ` Ryan Mallon
2012-01-13 21:52 ` Russell King - ARM Linux
2012-01-11 3:14 ` [PATCH 10/11] ep93xx: Move EP93XX_SYSCON defines to SoC private header Ryan Mallon
2012-01-13 17:52 ` H Hartley Sweeten
2012-01-11 3:14 ` [PATCH 11/11] ep93xx: Remove unnecessary includes of ep93xx-regs.h Ryan Mallon
2012-01-13 17:54 ` H Hartley Sweeten
2012-01-12 0:17 ` [PATCH 00/11] ep93xx: Move SoC private bits to core Ryan Mallon
2012-01-13 17:56 ` H Hartley Sweeten
2012-01-14 19:07 ` Mika Westerberg
2012-01-16 4:51 ` Ryan Mallon
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=4F10A4F7.60503@gmail.com \
--to=rmallon@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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: 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).