* [GIT PULL] Please pull tegra board updates for .39
From: Olof Johansson @ 2011-02-22 20:40 UTC (permalink / raw)
To: linux-arm-kernel
Colin,
The following changes since commit 92591f0c0e55f647ea0718711178bbeb2a261374:
Colin Cross (1):
ARM: tegra: common: Enable core clocks
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/olof/tegra-2.6.git
boards-for-next
Olof Johansson (7):
ARM: tegra: add tegra_gpio_table and tegra_gpio_config
ARM: tegra: harmony: move over to tegra_gpio_config
ARM: tegra: common device resources
ARM: tegra: remove stale nvidia atag handler
ARM: tegra: harmony: register sdhci devices
ARM: tegra: harmony: fix pinmux for MMC slot
ARM: tegra: add seaboard, wario and kaen boards
arch/arm/mach-tegra/Kconfig | 19 +
arch/arm/mach-tegra/Makefile | 4 +
arch/arm/mach-tegra/board-harmony-pinmux.c | 19 +-
arch/arm/mach-tegra/board-harmony.c | 55 ++--
arch/arm/mach-tegra/board-seaboard-pinmux.c | 179 ++++++++++
arch/arm/mach-tegra/board-seaboard.c | 196 +++++++++++
arch/arm/mach-tegra/board-seaboard.h | 38 ++
arch/arm/mach-tegra/devices.c | 505 +++++++++++++++++++++++++++
arch/arm/mach-tegra/devices.h | 46 +++
arch/arm/mach-tegra/gpio.c | 14 +
arch/arm/mach-tegra/include/mach/gpio.h | 7 +
11 files changed, 1054 insertions(+), 28 deletions(-)
create mode 100644 arch/arm/mach-tegra/board-seaboard-pinmux.c
create mode 100644 arch/arm/mach-tegra/board-seaboard.c
create mode 100644 arch/arm/mach-tegra/board-seaboard.h
create mode 100644 arch/arm/mach-tegra/devices.c
create mode 100644 arch/arm/mach-tegra/devices.h
^ permalink raw reply
* [PATCH] ARM: tegra: Hide EMC scaling config behind ARCH_TEGRA
From: Olof Johansson @ 2011-02-22 20:40 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298406924-2074-1-git-send-email-broonie@opensource.wolfsonmicro.com>
On Tue, Feb 22, 2011 at 12:35 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> The option isn't terribly useful on other ARM platforms.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Olof Johansson <olof@lixom.net>
-Olof
^ permalink raw reply
* [PATCH 1/6] ARM: tegra: add tegra_gpio_table and tegra_gpio_config
From: Russell King - ARM Linux @ 2011-02-22 20:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298354117-19097-2-git-send-email-olof@lixom.net>
On Mon, Feb 21, 2011 at 11:55:12PM -0600, Olof Johansson wrote:
> #include <linux/kernel.h>
> #include <mach/pinmux.h>
> +#include <mach/gpio.h>
linux/gpio.h please
^ permalink raw reply
* [PATCH] msm: add single-wire serial bus interface (SSBI) driver
From: Dima Zavin @ 2011-02-22 20:47 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298054771.17758.1.camel@c-dwalke-linux.qualcomm.com>
On Fri, Feb 18, 2011 at 10:46 AM, Daniel Walker <dwalker@codeaurora.org> wrote:
> On Thu, 2011-02-17 at 16:51 -0800, Bryan Huntsman wrote:
>> On 02/17/2011 04:37 PM, Daniel Walker wrote:
>> > Can you put this in drivers/ this doesn't looks like it need to be here.
>>
>> Where would you suggest? ?The initial attempt to model SSBI as an I2C
>> bus didn't go anywhere. ?See http://lkml.org/lkml/2010/7/21/400. ?This
>> functionality is specific to MSM. ?Plus, we're trying to maintain
>> similarity to the Android MSM tree. ?That may not matter to people who
>> don't use MSM, but is matters to us. ?Given these considerations, the
>> current location seems as good a place as any.
>
> I don't know the driver well enough to be more detailed than suggesting
> drivers/ . In the thread you quoted Pavel (who I added to the CC line)
> suggested drivers/ssbi/ .
I'm not sure that knowing the driver would help. SSBI is a Qualcomm
proprietary protocol that will only ever have one ssbi "host" driver
in it. The slave is always the PMIC (maybe the audio codec too, but
that's normally speaking i2c even in qualcomm's case). The slave PMIC
drivers, however, will go under drivers/mfd for the core and the
peripheral drivers into the appropriate drivers/xxx/ dirs, just like
all the other pmic drivers. The audio codec would go into
sound/soc/codecs. Thus, adding drivers/ssbi/ to just house ssbi.c
doesn't really make sense to me.
What is the problem leaving it under arch/arm/mach-msm?
--Dima
^ permalink raw reply
* [PATCH 6/6] ARM: tegra: add seaboard, wario and kaen boards
From: Russell King - ARM Linux @ 2011-02-22 20:48 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298354117-19097-7-git-send-email-olof@lixom.net>
On Mon, Feb 21, 2011 at 11:55:17PM -0600, Olof Johansson wrote:
> +++ b/arch/arm/mach-tegra/board-seaboard-pinmux.c
> @@ -0,0 +1,179 @@
> +/*
> + * Copyright (C) 2010 NVIDIA Corporation
> + *
> + * This software is licensed under the terms of the GNU General Public
> + * License version 2, as published by the Free Software Foundation, and
> + * may be copied, distributed, and modified under those terms.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +
> +#include <mach/pinmux.h>
> +#include <mach/pinmux-t2.h>
> +#include <mach/gpio.h>
Another linux/gpio.h please.
^ permalink raw reply
* [PATCH 5/7] ARM: tegra: timer: Enable timer and rtc clocks
From: Russell King - ARM Linux @ 2011-02-22 20:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298342392-21236-6-git-send-email-ccross@android.com>
On Mon, Feb 21, 2011 at 06:39:50PM -0800, Colin Cross wrote:
> + struct clk *clk;
> unsigned long rate = clk_measure_input_freq();
> int ret;
>
> + clk = clk_get_sys("timer", NULL);
> + BUG_ON(IS_ERR(clk));
> + clk_enable(clk);
> + clk_put(clk);
> +
> + clk = clk_get_sys("rtc-tegra", NULL);
> + BUG_ON(IS_ERR(clk));
> + clk_enable(clk);
> + clk_put(clk);
It's probably better to leave them get'd if you're continuing to use
them and just forget the reference.
^ permalink raw reply
* [PATCH] ARM: tegra: Hide EMC scaling config behind ARCH_TEGRA
From: Colin Cross @ 2011-02-22 20:57 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <AANLkTim7ZOeEC1muV8trT1bSc6DHMerxUjRmthnpt0Ui@mail.gmail.com>
On Tue, Feb 22, 2011 at 12:40 PM, Olof Johansson <olof@lixom.net> wrote:
> On Tue, Feb 22, 2011 at 12:35 PM, Mark Brown
> <broonie@opensource.wolfsonmicro.com> wrote:
>> The option isn't terribly useful on other ARM platforms.
>>
>> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
>
> Acked-by: Olof Johansson <olof@lixom.net>
>
>
> -Olof
Oops, thanks. Pushed to for-next.
^ permalink raw reply
* [PATCH 1/6] ARM: tegra: add tegra_gpio_table and tegra_gpio_config
From: Olof Johansson @ 2011-02-22 21:00 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110222204654.GD29559@n2100.arm.linux.org.uk>
On Tue, Feb 22, 2011 at 12:46 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Mon, Feb 21, 2011 at 11:55:12PM -0600, Olof Johansson wrote:
>> ?#include <linux/kernel.h>
>> ?#include <mach/pinmux.h>
>> +#include <mach/gpio.h>
>
> linux/gpio.h please
Thanks, fixed.
-Olof
^ permalink raw reply
* [PATCH 6/6] ARM: tegra: add seaboard, wario and kaen boards
From: Olof Johansson @ 2011-02-22 21:05 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110222204821.GE29559@n2100.arm.linux.org.uk>
On Tue, Feb 22, 2011 at 12:48 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
>> +#include <mach/gpio.h>
>
> Another linux/gpio.h please.
Another d'oh. Thanks.
mach/io.h and mach/gpio.h seem to be common mistakes in general. I'll
look at adding it to checkpatch while I'm still annoyed at having made
the mistakes. :)
-olof
^ permalink raw reply
* [PATCHv2 2/2] DM9000B: Fix PHY power for network down/up
From: Henry Nestler @ 2011-02-22 21:29 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110222.102410.260079835.davem@davemloft.net>
DM9000 revision B needs 1 ms delay after PHY power-on.
PHY must be powered on by writing 0 into register DM9000_GPR before
all other settings will change (see Davicom spec and example code).
Remember, that register DM9000_GPR was not changed by reset sequence.
Without this fix the FIFO is out of sync and sends wrong data after
sequence of "ifconfig ethX down ; ifconfig ethX up".
---
Kernel version 2.6.38-rc5
drivers/net/dm9000.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 2d4c4fc..5925569 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -802,10 +802,7 @@ dm9000_init_dm9000(struct net_device *dev)
/* Checksum mode */
dm9000_set_rx_csum_unlocked(dev, db->rx_csum);
- /* GPIO0 on pre-activate PHY */
- iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */
iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */
- iow(db, DM9000_GPR, 0); /* Enable PHY */
ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0;
@@ -1194,6 +1191,10 @@ dm9000_open(struct net_device *dev)
if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev))
return -EAGAIN;
+ /* GPIO0 on pre-activate PHY, Reg 1F is not set by reset */
+ iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */
+ mdelay(1); /* delay needs by DM9000B */
+
/* Initialize DM9000 board */
dm9000_reset(db);
dm9000_init_dm9000(dev);
^ permalink raw reply related
* [PATCH] ARM: fix build failure
From: Tony Lindgren @ 2011-02-22 21:57 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298406402-31572-1-git-send-email-u.kleine-koenig@pengutronix.de>
* Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> [110222 12:25]:
> Commit
>
> 06824ba (ARM: tlb: delay page freeing for SMP and ARMv7 CPUs)
>
> introduced a build failure for builds with CONFIG_SWAP=n:
>
> In file included from arch/arm/mm/init.c:27:
> arch/arm/include/asm/tlb.h: In function 'tlb_flush_mmu':
> arch/arm/include/asm/tlb.h:101: error: implicit declaration of function 'release_pages'
> arch/arm/include/asm/tlb.h: In function 'tlb_remove_page':
> arch/arm/include/asm/tlb.h:165: error: implicit declaration of function 'page_cache_release'
>
> Fix that by #including <linux/pagemap.h> in <asm/pgalloc.h> as it's done
> by x86.
>
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Acked-by: Tony Lindgren <tony@atomide.com>
^ permalink raw reply
* [PATCH] ARM: fix build failure
From: Russell King - ARM Linux @ 2011-02-22 22:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298406402-31572-1-git-send-email-u.kleine-koenig@pengutronix.de>
Looks good. Can you stick it in the patch system please?
On Tue, Feb 22, 2011 at 09:26:42PM +0100, Uwe Kleine-K?nig wrote:
> Commit
>
> 06824ba (ARM: tlb: delay page freeing for SMP and ARMv7 CPUs)
>
> introduced a build failure for builds with CONFIG_SWAP=n:
>
> In file included from arch/arm/mm/init.c:27:
> arch/arm/include/asm/tlb.h: In function 'tlb_flush_mmu':
> arch/arm/include/asm/tlb.h:101: error: implicit declaration of function 'release_pages'
> arch/arm/include/asm/tlb.h: In function 'tlb_remove_page':
> arch/arm/include/asm/tlb.h:165: error: implicit declaration of function 'page_cache_release'
>
> Fix that by #including <linux/pagemap.h> in <asm/pgalloc.h> as it's done
> by x86.
>
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> ---
> arch/arm/include/asm/pgalloc.h | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/include/asm/pgalloc.h b/arch/arm/include/asm/pgalloc.h
> index 9763be0..22de005 100644
> --- a/arch/arm/include/asm/pgalloc.h
> +++ b/arch/arm/include/asm/pgalloc.h
> @@ -10,6 +10,8 @@
> #ifndef _ASMARM_PGALLOC_H
> #define _ASMARM_PGALLOC_H
>
> +#include <linux/pagemap.h>
> +
> #include <asm/domain.h>
> #include <asm/pgtable-hwdef.h>
> #include <asm/processor.h>
> --
> 1.7.2.3
>
^ permalink raw reply
* [PATCH] ARM: fix build failure
From: Uwe Kleine-König @ 2011-02-22 22:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110222222628.GC31275@n2100.arm.linux.org.uk>
On Tue, Feb 22, 2011 at 10:26:28PM +0000, Russell King - ARM Linux wrote:
> Looks good. Can you stick it in the patch system please?
done as
http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=6757/1
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* SAMSUNG: any example code for soc_camera, tv output, etc...?
From: Nick Pelling @ 2011-02-22 22:54 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <AANLkTin0PR3VQLruade+w6GbCMoW9pXy4Kvn-sBZ+LBM@mail.gmail.c om>
Hi yujinzhi,
At 22:00 22/02/2011 +0800, =?GB2312?B?0+C999bH?= wrote:
>I have port a embeded linux system on my board based on EP9315, with
>support for usb video capture device, V4L2. Do you need V4L2 based on
>usb video capture device or other video/FM/AM controller on your
>board? If conveniently, can you provide more details about your
>project?
It's a tiny S5PC100 board with an Aptina MT9M131 (1.3MP) sensor and
video out for some security camera projects I'm working on. I've just
brought up another embedded V4L2-based Linux camera, so V4L2 would be
nice - in fact, there's already some Samsung s5p fimc code checked
into the main tree, but it's far from clear (to me, at least) how to
go about integrating image sensors with that to get V4L2 working.
>You MUST need the datasheet of S5PC100 on your board, and other
>peripheral device's datasheet, like dm9000 ethernet controller if not
>integrated in SoC, and schematic diagrams of your board.
Hardware datasheets I have plenty of, it's the supporting
documentation on the s3c fb / s5p fimc devices / v4l2 host stuff that
I'm missing. Not a lot in the Documentation/arm/Samsung* directories,
for example. :-(
Cheers, ....Nick Pelling....
^ permalink raw reply
* [PATCH 1/6] ARM: tegra: add tegra_gpio_table and tegra_gpio_config
From: Erik Gilling @ 2011-02-22 23:14 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <AANLkTimBh2qDx71+P3QCeWJ0sKS1AzYOUohAdSW=AoeS@mail.gmail.com>
Cool
Acked-by: Erik Gilling <konkers@android.com>
On Tue, Feb 22, 2011 at 11:35 AM, Olof Johansson <olof@lixom.net> wrote:
> Hi
>
> On Tue, Feb 22, 2011 at 11:18 AM, Erik Gilling <konkers@android.com> wrote:
>> Can you split the boardfile changes into their own patch? ?Also see
>> the below whitespace only change. ?Other than that, looks good.
>
> Ok, done (will push separately, no need to repost just with the split though).
>
> Thanks.
>
>
>>> ?}
>>> -
>>> ?postcore_initcall(tegra_gpio_init);
>>
>> whitespace only change
>
> D'oh, sloppy of me. Fixed.
>
>
> -Olof
>
^ permalink raw reply
* [PATCH] ARM: imx/mach-mx25_3ds: Use IMX_GPIO_NR instead of hard-coded values
From: Fabio Estevam @ 2011-02-22 23:24 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
arch/arm/mach-imx/mach-mx25_3ds.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-imx/mach-mx25_3ds.c b/arch/arm/mach-imx/mach-mx25_3ds.c
index aafc6f7..66b6cdd 100644
--- a/arch/arm/mach-imx/mach-mx25_3ds.c
+++ b/arch/arm/mach-imx/mach-mx25_3ds.c
@@ -109,8 +109,8 @@ static const struct fec_platform_data mx25_fec_pdata __initconst = {
.phy = PHY_INTERFACE_MODE_RMII,
};
-#define FEC_ENABLE_GPIO 35
-#define FEC_RESET_B_GPIO 104
+#define FEC_ENABLE_GPIO IMX_GPIO_NR(2, 3)
+#define FEC_RESET_B_GPIO IMX_GPIO_NR(4, 8)
static void __init mx25pdk_fec_reset(void)
{
--
1.6.0.4
^ permalink raw reply related
* [PATCH 1/3] pxa: Enable pxa-pcm-audio on pxa210/pxa25x platform
From: Dmitry Eremin-Solenikov @ 2011-02-22 23:29 UTC (permalink / raw)
To: linux-arm-kernel
pxa25x platforms were left out of major ASoC Update patch.
Since f0fba2ad1b a registration of pxa-pcm-audio device is required for
ASoC to function on pxa platforms. Register one also for pxa210/pxa25x.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
---
arch/arm/mach-pxa/pxa25x.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index fbc5b77..b166b1d 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -347,6 +347,7 @@ static struct platform_device *pxa25x_devices[] __initdata = {
&pxa25x_device_assp,
&pxa25x_device_pwm0,
&pxa25x_device_pwm1,
+ &pxa_device_asoc_platform,
};
static struct sys_device pxa25x_sysdev[] = {
--
1.7.2.3
^ permalink raw reply related
* [PATCH 2/3] tosa: register wm9712 codec device
From: Dmitry Eremin-Solenikov @ 2011-02-22 23:29 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298417351-24727-1-git-send-email-dbaryshkov@gmail.com>
Since f0fba2ad1b it's required to register platform devices even for
AC'97 codecs. Register one on tosa (wm9712-codec).
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
---
arch/arm/mach-pxa/tosa.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 88b2329..7753d22 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -884,6 +884,11 @@ static struct platform_device sharpsl_rom_device = {
.dev.platform_data = &sharpsl_rom_data,
};
+static struct platform_device wm9712_device = {
+ .name = "wm9712-codec",
+ .id = -1,
+};
+
static struct platform_device *devices[] __initdata = {
&tosascoop_device,
&tosascoop_jc_device,
@@ -895,6 +900,7 @@ static struct platform_device *devices[] __initdata = {
&tosa_bt_device,
&sharpsl_rom_device,
&tosa_gpio_vbus,
+ &wm9712_device,
};
static void tosa_poweroff(void)
--
1.7.2.3
^ permalink raw reply related
* [PATCH 3/3] ASoC: correct pxa AC97 DAI names
From: Dmitry Eremin-Solenikov @ 2011-02-22 23:29 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298417351-24727-1-git-send-email-dbaryshkov@gmail.com>
Correct names for pxa AC97 DAI are pxa2xx-ac97 and pxa2xx-ac97-aux. Fix
that for all PXA platforms.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
sound/soc/pxa/e740_wm9705.c | 4 ++--
sound/soc/pxa/e750_wm9705.c | 4 ++--
sound/soc/pxa/e800_wm9712.c | 4 ++--
sound/soc/pxa/em-x270.c | 4 ++--
sound/soc/pxa/mioa701_wm9713.c | 4 ++--
sound/soc/pxa/palm27x.c | 4 ++--
sound/soc/pxa/tosa.c | 4 ++--
sound/soc/pxa/zylonite.c | 4 ++--
8 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/sound/soc/pxa/e740_wm9705.c b/sound/soc/pxa/e740_wm9705.c
index 28333e7..dc65650 100644
--- a/sound/soc/pxa/e740_wm9705.c
+++ b/sound/soc/pxa/e740_wm9705.c
@@ -117,7 +117,7 @@ static struct snd_soc_dai_link e740_dai[] = {
{
.name = "AC97",
.stream_name = "AC97 HiFi",
- .cpu_dai_name = "pxa-ac97.0",
+ .cpu_dai_name = "pxa2xx-ac97",
.codec_dai_name = "wm9705-hifi",
.platform_name = "pxa-pcm-audio",
.codec_name = "wm9705-codec",
@@ -126,7 +126,7 @@ static struct snd_soc_dai_link e740_dai[] = {
{
.name = "AC97 Aux",
.stream_name = "AC97 Aux",
- .cpu_dai_name = "pxa-ac97.1",
+ .cpu_dai_name = "pxa2xx-ac97-aux",
.codec_dai_name = "wm9705-aux",
.platform_name = "pxa-pcm-audio",
.codec_name = "wm9705-codec",
diff --git a/sound/soc/pxa/e750_wm9705.c b/sound/soc/pxa/e750_wm9705.c
index 01bf316..51897fc 100644
--- a/sound/soc/pxa/e750_wm9705.c
+++ b/sound/soc/pxa/e750_wm9705.c
@@ -99,7 +99,7 @@ static struct snd_soc_dai_link e750_dai[] = {
{
.name = "AC97",
.stream_name = "AC97 HiFi",
- .cpu_dai_name = "pxa-ac97.0",
+ .cpu_dai_name = "pxa2xx-ac97",
.codec_dai_name = "wm9705-hifi",
.platform_name = "pxa-pcm-audio",
.codec_name = "wm9705-codec",
@@ -109,7 +109,7 @@ static struct snd_soc_dai_link e750_dai[] = {
{
.name = "AC97 Aux",
.stream_name = "AC97 Aux",
- .cpu_dai_name = "pxa-ac97.1",
+ .cpu_dai_name = "pxa2xx-ac97-aux",
.codec_dai_name ="wm9705-aux",
.platform_name = "pxa-pcm-audio",
.codec_name = "wm9705-codec",
diff --git a/sound/soc/pxa/e800_wm9712.c b/sound/soc/pxa/e800_wm9712.c
index c6a37c6..053ed20 100644
--- a/sound/soc/pxa/e800_wm9712.c
+++ b/sound/soc/pxa/e800_wm9712.c
@@ -89,7 +89,7 @@ static struct snd_soc_dai_link e800_dai[] = {
{
.name = "AC97",
.stream_name = "AC97 HiFi",
- .cpu_dai_name = "pxa-ac97.0",
+ .cpu_dai_name = "pxa2xx-ac97",
.codec_dai_name = "wm9712-hifi",
.platform_name = "pxa-pcm-audio",
.codec_name = "wm9712-codec",
@@ -98,7 +98,7 @@ static struct snd_soc_dai_link e800_dai[] = {
{
.name = "AC97 Aux",
.stream_name = "AC97 Aux",
- .cpu_dai_name = "pxa-ac97.1",
+ .cpu_dai_name = "pxa2xx-ac97-aux",
.codec_dai_name ="wm9712-aux",
.platform_name = "pxa-pcm-audio",
.codec_name = "wm9712-codec",
diff --git a/sound/soc/pxa/em-x270.c b/sound/soc/pxa/em-x270.c
index fc22e6e..b13a425 100644
--- a/sound/soc/pxa/em-x270.c
+++ b/sound/soc/pxa/em-x270.c
@@ -37,7 +37,7 @@ static struct snd_soc_dai_link em_x270_dai[] = {
{
.name = "AC97",
.stream_name = "AC97 HiFi",
- .cpu_dai_name = "pxa-ac97.0",
+ .cpu_dai_name = "pxa2xx-ac97",
.codec_dai_name = "wm9712-hifi",
.platform_name = "pxa-pcm-audio",
.codec_name = "wm9712-codec",
@@ -45,7 +45,7 @@ static struct snd_soc_dai_link em_x270_dai[] = {
{
.name = "AC97 Aux",
.stream_name = "AC97 Aux",
- .cpu_dai_name = "pxa-ac97.1",
+ .cpu_dai_name = "pxa2xx-ac97-aux",
.codec_dai_name ="wm9712-aux",
.platform_name = "pxa-pcm-audio",
.codec_name = "wm9712-codec",
diff --git a/sound/soc/pxa/mioa701_wm9713.c b/sound/soc/pxa/mioa701_wm9713.c
index 0d70fc8..38ca675 100644
--- a/sound/soc/pxa/mioa701_wm9713.c
+++ b/sound/soc/pxa/mioa701_wm9713.c
@@ -162,7 +162,7 @@ static struct snd_soc_dai_link mioa701_dai[] = {
{
.name = "AC97",
.stream_name = "AC97 HiFi",
- .cpu_dai_name = "pxa-ac97.0",
+ .cpu_dai_name = "pxa2xx-ac97",
.codec_dai_name = "wm9713-hifi",
.codec_name = "wm9713-codec",
.init = mioa701_wm9713_init,
@@ -172,7 +172,7 @@ static struct snd_soc_dai_link mioa701_dai[] = {
{
.name = "AC97 Aux",
.stream_name = "AC97 Aux",
- .cpu_dai_name = "pxa-ac97.1",
+ .cpu_dai_name = "pxa2xx-ac97-aux",
.codec_dai_name ="wm9713-aux",
.codec_name = "wm9713-codec",
.platform_name = "pxa-pcm-audio",
diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c
index 857db96..504e400 100644
--- a/sound/soc/pxa/palm27x.c
+++ b/sound/soc/pxa/palm27x.c
@@ -132,7 +132,7 @@ static struct snd_soc_dai_link palm27x_dai[] = {
{
.name = "AC97 HiFi",
.stream_name = "AC97 HiFi",
- .cpu_dai_name = "pxa-ac97.0",
+ .cpu_dai_name = "pxa2xx-ac97",
.codec_dai_name = "wm9712-hifi",
.codec_name = "wm9712-codec",
.platform_name = "pxa-pcm-audio",
@@ -141,7 +141,7 @@ static struct snd_soc_dai_link palm27x_dai[] = {
{
.name = "AC97 Aux",
.stream_name = "AC97 Aux",
- .cpu_dai_name = "pxa-ac97.1",
+ .cpu_dai_name = "pxa2xx-ac97-aux",
.codec_dai_name = "wm9712-aux",
.codec_name = "wm9712-codec",
.platform_name = "pxa-pcm-audio",
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c
index f75804e..4b6e5d6 100644
--- a/sound/soc/pxa/tosa.c
+++ b/sound/soc/pxa/tosa.c
@@ -219,7 +219,7 @@ static struct snd_soc_dai_link tosa_dai[] = {
{
.name = "AC97",
.stream_name = "AC97 HiFi",
- .cpu_dai_name = "pxa-ac97.0",
+ .cpu_dai_name = "pxa2xx-ac97",
.codec_dai_name = "wm9712-hifi",
.platform_name = "pxa-pcm-audio",
.codec_name = "wm9712-codec",
@@ -229,7 +229,7 @@ static struct snd_soc_dai_link tosa_dai[] = {
{
.name = "AC97 Aux",
.stream_name = "AC97 Aux",
- .cpu_dai_name = "pxa-ac97.1",
+ .cpu_dai_name = "pxa2xx-ac97-aux",
.codec_dai_name = "wm9712-aux",
.platform_name = "pxa-pcm-audio",
.codec_name = "wm9712-codec",
diff --git a/sound/soc/pxa/zylonite.c b/sound/soc/pxa/zylonite.c
index b222a7d..25bba10 100644
--- a/sound/soc/pxa/zylonite.c
+++ b/sound/soc/pxa/zylonite.c
@@ -166,7 +166,7 @@ static struct snd_soc_dai_link zylonite_dai[] = {
.stream_name = "AC97 HiFi",
.codec_name = "wm9713-codec",
.platform_name = "pxa-pcm-audio",
- .cpu_dai_name = "pxa-ac97.0",
+ .cpu_dai_name = "pxa2xx-ac97",
.codec_name = "wm9713-hifi",
.init = zylonite_wm9713_init,
},
@@ -175,7 +175,7 @@ static struct snd_soc_dai_link zylonite_dai[] = {
.stream_name = "AC97 Aux",
.codec_name = "wm9713-codec",
.platform_name = "pxa-pcm-audio",
- .cpu_dai_name = "pxa-ac97.1",
+ .cpu_dai_name = "pxa2xx-ac97-aux",
.codec_name = "wm9713-aux",
},
{
--
1.7.2.3
^ permalink raw reply related
* [PATCH] colibri : don't register pxa2xx-pcmcia nodes on non-colibri platforms
From: Dmitry Eremin-Solenikov @ 2011-02-22 23:30 UTC (permalink / raw)
To: linux-arm-kernel
PXA supports multi-machine kernels since long ago. However a kernel
compiled with support for colibri and any other PXA machine and with
PCMCIA enabled will barf at runtime about duplicate registration of
pxa2xx-pcmcia device. Fix that.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
drivers/pcmcia/pxa2xx_colibri.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/pcmcia/pxa2xx_colibri.c b/drivers/pcmcia/pxa2xx_colibri.c
index c3f7219..a520395 100644
--- a/drivers/pcmcia/pxa2xx_colibri.c
+++ b/drivers/pcmcia/pxa2xx_colibri.c
@@ -181,6 +181,9 @@ static int __init colibri_pcmcia_init(void)
{
int ret;
+ if (!machine_is_colibri() && !machine_is_colibri320())
+ return -ENODEV;
+
colibri_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1);
if (!colibri_pcmcia_device)
return -ENOMEM;
--
1.7.2.3
^ permalink raw reply related
* [PATCH] wip: convert imx27 to common struct clk
From: Uwe Kleine-König @ 2011-02-22 23:33 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298256658.861611.43913489619.0.gpush@pororo>
Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
Hello,
on top of .38-rc6 + making the clk_{un,}prepare stubs static inline,
this patch makes use of Jeremy's common struct clk (v13) on a i.MX27 based
machine.
This is compile tested using mx21_defconfig and runtime tested using
mx27_defconfig.
I had to degrade one WARN_ON to WARN_ON_ONCE in drivers/clk/clk.c to
actually make it work. Otherwise console output results in a warning
that results in console output ...
Best regards
Uwe
arch/arm/mach-imx/Kconfig | 1 +
arch/arm/mach-imx/clock-imx27.c | 186 ++++++++++++++++--------------
arch/arm/plat-mxc/clock.c | 127 +++++++++++++++++++++
arch/arm/plat-mxc/include/mach/clkdev.h | 4 +
arch/arm/plat-mxc/include/mach/clock.h | 32 ++++--
drivers/clk/clk.c | 2 +-
6 files changed, 255 insertions(+), 97 deletions(-)
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 56684b5..f2d3708 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -30,6 +30,7 @@ config SOC_IMX27
select IMX_HAVE_DMA_V1
select IMX_HAVE_IOMUX_V1
select MXC_AVIC
+ select USE_COMMON_STRUCT_CLK
if ARCH_MX1
diff --git a/arch/arm/mach-imx/clock-imx27.c b/arch/arm/mach-imx/clock-imx27.c
index 583f251..f413f7b 100644
--- a/arch/arm/mach-imx/clock-imx27.c
+++ b/arch/arm/mach-imx/clock-imx27.c
@@ -68,35 +68,35 @@
#define CCM_SPCTL1_LF (1 << 15)
#define CCM_SPCTL1_BRMO (1 << 6)
-static struct clk mpll_main1_clk, mpll_main2_clk;
+static struct clk_mxc mpll_main1_clk, mpll_main2_clk;
-static int clk_pccr_enable(struct clk *clk)
+static int clk_pccr_enable(struct clk_mxc *clk_mxc)
{
unsigned long reg;
- if (!clk->enable_reg)
+ if (!clk_mxc->enable_reg)
return 0;
- reg = __raw_readl(clk->enable_reg);
- reg |= 1 << clk->enable_shift;
- __raw_writel(reg, clk->enable_reg);
+ reg = __raw_readl(clk_mxc->enable_reg);
+ reg |= 1 << clk_mxc->enable_shift;
+ __raw_writel(reg, clk_mxc->enable_reg);
return 0;
}
-static void clk_pccr_disable(struct clk *clk)
+static void clk_pccr_disable(struct clk_mxc *clk_mxc)
{
unsigned long reg;
- if (!clk->enable_reg)
+ if (!clk_mxc->enable_reg)
return;
- reg = __raw_readl(clk->enable_reg);
- reg &= ~(1 << clk->enable_shift);
- __raw_writel(reg, clk->enable_reg);
+ reg = __raw_readl(clk_mxc->enable_reg);
+ reg &= ~(1 << clk_mxc->enable_shift);
+ __raw_writel(reg, clk_mxc->enable_reg);
}
-static int clk_spll_enable(struct clk *clk)
+static int clk_spll_enable(struct clk_mxc *clk_mxc)
{
unsigned long reg;
@@ -109,7 +109,7 @@ static int clk_spll_enable(struct clk *clk)
return 0;
}
-static void clk_spll_disable(struct clk *clk)
+static void clk_spll_disable(struct clk_mxc *clk_mxc)
{
unsigned long reg;
@@ -118,11 +118,11 @@ static void clk_spll_disable(struct clk *clk)
__raw_writel(reg, CCM_CSCR);
}
-static int clk_cpu_set_parent(struct clk *clk, struct clk *parent)
+static int clk_cpu_set_parent(struct clk_mxc *clk_mxc, struct clk_mxc *parent)
{
int cscr = __raw_readl(CCM_CSCR);
- if (clk->parent == parent)
+ if (clk_mxc->parent == parent)
return 0;
if (mx27_revision() >= IMX_CHIP_REVISION_2_0) {
@@ -135,18 +135,18 @@ static int clk_cpu_set_parent(struct clk *clk, struct clk *parent)
return -EINVAL;
}
__raw_writel(cscr, CCM_CSCR);
- clk->parent = parent;
+ clk_mxc->parent = parent;
return 0;
}
return -ENODEV;
}
-static unsigned long round_rate_cpu(struct clk *clk, unsigned long rate)
+static unsigned long round_rate_cpu(struct clk_mxc *clk_mxc, unsigned long rate)
{
int div;
unsigned long parent_rate;
- parent_rate = clk_get_rate(clk->parent);
+ parent_rate = clk_get_rate(&clk_mxc->parent->clk);
div = parent_rate / rate;
if (parent_rate % rate)
@@ -158,13 +158,13 @@ static unsigned long round_rate_cpu(struct clk *clk, unsigned long rate)
return parent_rate / div;
}
-static int set_rate_cpu(struct clk *clk, unsigned long rate)
+static int set_rate_cpu(struct clk_mxc *clk_mxc, unsigned long rate)
{
unsigned int div;
uint32_t reg;
unsigned long parent_rate;
- parent_rate = clk_get_rate(clk->parent);
+ parent_rate = clk_get_rate(&clk_mxc->parent->clk);
div = parent_rate / rate;
@@ -186,12 +186,12 @@ static int set_rate_cpu(struct clk *clk, unsigned long rate)
return 0;
}
-static unsigned long round_rate_per(struct clk *clk, unsigned long rate)
+static unsigned long round_rate_per(struct clk_mxc *clk_mxc, unsigned long rate)
{
u32 div;
unsigned long parent_rate;
- parent_rate = clk_get_rate(clk->parent);
+ parent_rate = clk_get_rate(&clk_mxc->parent->clk);
div = parent_rate / rate;
if (parent_rate % rate)
@@ -203,15 +203,15 @@ static unsigned long round_rate_per(struct clk *clk, unsigned long rate)
return parent_rate / div;
}
-static int set_rate_per(struct clk *clk, unsigned long rate)
+static int set_rate_per(struct clk_mxc *clk_mxc, unsigned long rate)
{
u32 reg;
u32 div;
unsigned long parent_rate;
- parent_rate = clk_get_rate(clk->parent);
+ parent_rate = clk_get_rate(&clk_mxc->parent->clk);
- if (clk->id < 0 || clk->id > 3)
+ if (clk_mxc->id < 0 || clk_mxc->id > 3)
return -EINVAL;
div = parent_rate / rate;
@@ -219,30 +219,30 @@ static int set_rate_per(struct clk *clk, unsigned long rate)
return -EINVAL;
div--;
- reg = __raw_readl(CCM_PCDR1) & ~(0x3f << (clk->id << 3));
- reg |= div << (clk->id << 3);
+ reg = __raw_readl(CCM_PCDR1) & ~(0x3f << (clk_mxc->id << 3));
+ reg |= div << (clk_mxc->id << 3);
__raw_writel(reg, CCM_PCDR1);
return 0;
}
-static unsigned long get_rate_usb(struct clk *clk)
+static unsigned long get_rate_usb(struct clk_mxc *clk_mxc)
{
unsigned long usb_pdf;
unsigned long parent_rate;
- parent_rate = clk_get_rate(clk->parent);
+ parent_rate = clk_get_rate(&clk_mxc->parent->clk);
usb_pdf = (__raw_readl(CCM_CSCR) >> 28) & 0x7;
return parent_rate / (usb_pdf + 1U);
}
-static unsigned long get_rate_ssix(struct clk *clk, unsigned long pdf)
+static unsigned long get_rate_ssix(struct clk_mxc *clk_mxc, unsigned long pdf)
{
unsigned long parent_rate;
- parent_rate = clk_get_rate(clk->parent);
+ parent_rate = clk_get_rate(&clk_mxc->parent->clk);
if (mx27_revision() >= IMX_CHIP_REVISION_2_0)
pdf += 4; /* MX27 TO2+ */
@@ -252,22 +252,22 @@ static unsigned long get_rate_ssix(struct clk *clk, unsigned long pdf)
return 2UL * parent_rate / pdf;
}
-static unsigned long get_rate_ssi1(struct clk *clk)
+static unsigned long get_rate_ssi1(struct clk_mxc *clk_mxc)
{
- return get_rate_ssix(clk, (__raw_readl(CCM_PCDR0) >> 16) & 0x3f);
+ return get_rate_ssix(clk_mxc, (__raw_readl(CCM_PCDR0) >> 16) & 0x3f);
}
-static unsigned long get_rate_ssi2(struct clk *clk)
+static unsigned long get_rate_ssi2(struct clk_mxc *clk_mxc)
{
- return get_rate_ssix(clk, (__raw_readl(CCM_PCDR0) >> 26) & 0x3f);
+ return get_rate_ssix(clk_mxc, (__raw_readl(CCM_PCDR0) >> 26) & 0x3f);
}
-static unsigned long get_rate_nfc(struct clk *clk)
+static unsigned long get_rate_nfc(struct clk_mxc *clk_mxc)
{
unsigned long nfc_pdf;
unsigned long parent_rate;
- parent_rate = clk_get_rate(clk->parent);
+ parent_rate = clk_get_rate(&clk_mxc->parent->clk);
if (mx27_revision() >= IMX_CHIP_REVISION_2_0)
nfc_pdf = (__raw_readl(CCM_PCDR0) >> 6) & 0xf;
@@ -277,12 +277,12 @@ static unsigned long get_rate_nfc(struct clk *clk)
return parent_rate / (nfc_pdf + 1);
}
-static unsigned long get_rate_vpu(struct clk *clk)
+static unsigned long get_rate_vpu(struct clk_mxc *clk_mxc)
{
unsigned long vpu_pdf;
unsigned long parent_rate;
- parent_rate = clk_get_rate(clk->parent);
+ parent_rate = clk_get_rate(&clk_mxc->parent->clk);
if (mx27_revision() >= IMX_CHIP_REVISION_2_0) {
vpu_pdf = (__raw_readl(CCM_PCDR0) >> 10) & 0x3f;
@@ -295,25 +295,25 @@ static unsigned long get_rate_vpu(struct clk *clk)
return 2UL * parent_rate / vpu_pdf;
}
-static unsigned long round_rate_parent(struct clk *clk, unsigned long rate)
+static unsigned long round_rate_parent(struct clk_mxc *clk_mxc, unsigned long rate)
{
- return clk->parent->round_rate(clk->parent, rate);
+ return clk_round_rate(&clk_mxc->parent->clk, rate);
}
-static unsigned long get_rate_parent(struct clk *clk)
+static unsigned long get_rate_parent(struct clk_mxc *clk_mxc)
{
- return clk_get_rate(clk->parent);
+ return clk_get_rate(&clk_mxc->parent->clk);
}
-static int set_rate_parent(struct clk *clk, unsigned long rate)
+static int set_rate_parent(struct clk_mxc *clk_mxc, unsigned long rate)
{
- return clk->parent->set_rate(clk->parent, rate);
+ return clk_set_rate(&clk_mxc->parent->clk, rate);
}
/* in Hz */
static unsigned long external_high_reference = 26000000;
-static unsigned long get_rate_high_reference(struct clk *clk)
+static unsigned long get_rate_high_reference(struct clk_mxc *clk)
{
return external_high_reference;
}
@@ -321,44 +321,44 @@ static unsigned long get_rate_high_reference(struct clk *clk)
/* in Hz */
static unsigned long external_low_reference = 32768;
-static unsigned long get_rate_low_reference(struct clk *clk)
+static unsigned long get_rate_low_reference(struct clk_mxc *clk_mxc)
{
return external_low_reference;
}
-static unsigned long get_rate_fpm(struct clk *clk)
+static unsigned long get_rate_fpm(struct clk_mxc *clk_mxc)
{
- return clk_get_rate(clk->parent) * 1024;
+ return clk_get_rate(&clk_mxc->parent->clk) * 1024;
}
-static unsigned long get_rate_mpll(struct clk *clk)
+static unsigned long get_rate_mpll(struct clk_mxc *clk_mxc)
{
return mxc_decode_pll(__raw_readl(CCM_MPCTL0),
- clk_get_rate(clk->parent));
+ clk_get_rate(&clk_mxc->parent->clk));
}
-static unsigned long get_rate_mpll_main(struct clk *clk)
+static unsigned long get_rate_mpll_main(struct clk_mxc *clk_mxc)
{
unsigned long parent_rate;
- parent_rate = clk_get_rate(clk->parent);
+ parent_rate = clk_get_rate(&clk_mxc->parent->clk);
/* i.MX27 TO2:
* clk->id == 0: arm clock source path 1 which is from 2 * MPLL / 2
* clk->id == 1: arm clock source path 2 which is from 2 * MPLL / 3
*/
- if (mx27_revision() >= IMX_CHIP_REVISION_2_0 && clk->id == 1)
+ if (mx27_revision() >= IMX_CHIP_REVISION_2_0 && clk_mxc->id == 1)
return 2UL * parent_rate / 3UL;
return parent_rate;
}
-static unsigned long get_rate_spll(struct clk *clk)
+static unsigned long get_rate_spll(struct clk_mxc *clk_mxc)
{
uint32_t reg;
unsigned long rate;
- rate = clk_get_rate(clk->parent);
+ rate = clk_get_rate(&clk_mxc->parent->clk);
reg = __raw_readl(CCM_SPCTL0);
@@ -371,7 +371,7 @@ static unsigned long get_rate_spll(struct clk *clk)
return mxc_decode_pll(reg, rate);
}
-static unsigned long get_rate_cpu(struct clk *clk)
+static unsigned long get_rate_cpu(struct clk_mxc *clk_mxc)
{
u32 div;
unsigned long rate;
@@ -381,11 +381,11 @@ static unsigned long get_rate_cpu(struct clk *clk)
else
div = (__raw_readl(CCM_CSCR) >> 13) & 0x7;
- rate = clk_get_rate(clk->parent);
+ rate = clk_get_rate(&clk_mxc->parent->clk);
return rate / (div + 1);
}
-static unsigned long get_rate_ahb(struct clk *clk)
+static unsigned long get_rate_ahb(struct clk_mxc *clk_mxc)
{
unsigned long rate, bclk_pdf;
@@ -394,33 +394,33 @@ static unsigned long get_rate_ahb(struct clk *clk)
else
bclk_pdf = (__raw_readl(CCM_CSCR) >> 9) & 0xf;
- rate = clk_get_rate(clk->parent);
+ rate = clk_get_rate(&clk_mxc->parent->clk);
return rate / (bclk_pdf + 1);
}
-static unsigned long get_rate_ipg(struct clk *clk)
+static unsigned long get_rate_ipg(struct clk_mxc *clk_mxc)
{
unsigned long rate, ipg_pdf;
if (mx27_revision() >= IMX_CHIP_REVISION_2_0)
- return clk_get_rate(clk->parent);
+ return clk_get_rate(&clk_mxc->parent->clk);
else
ipg_pdf = (__raw_readl(CCM_CSCR) >> 8) & 1;
- rate = clk_get_rate(clk->parent);
+ rate = clk_get_rate(&clk_mxc->parent->clk);
return rate / (ipg_pdf + 1);
}
-static unsigned long get_rate_per(struct clk *clk)
+static unsigned long get_rate_per(struct clk_mxc *clk_mxc)
{
unsigned long perclk_pdf, parent_rate;
- parent_rate = clk_get_rate(clk->parent);
+ parent_rate = clk_get_rate(&clk_mxc->parent->clk);
- if (clk->id < 0 || clk->id > 3)
+ if (clk_mxc->id < 0 || clk_mxc->id > 3)
return 0;
- perclk_pdf = (__raw_readl(CCM_PCDR1) >> (clk->id << 3)) & 0x3f;
+ perclk_pdf = (__raw_readl(CCM_PCDR1) >> (clk_mxc->id << 3)) & 0x3f;
return parent_rate / (perclk_pdf + 1);
}
@@ -430,11 +430,13 @@ static unsigned long get_rate_per(struct clk *clk)
* Default case is 26MHz. Could be changed@runtime
* with a call to change_external_high_reference()
*/
-static struct clk ckih_clk = {
+static struct clk_mxc ckih_clk = {
+ .clk = INIT_CLK_MXC(ckih_clk),
.get_rate = get_rate_high_reference,
};
-static struct clk mpll_clk = {
+static struct clk_mxc mpll_clk = {
+ .clk = INIT_CLK_MXC(mpll_clk),
.parent = &ckih_clk,
.get_rate = get_rate_mpll,
};
@@ -442,7 +444,8 @@ static struct clk mpll_clk = {
/* For i.MX27 TO2, it is the MPLL path 1 of ARM core
* It provides the clock source whose rate is same as MPLL
*/
-static struct clk mpll_main1_clk = {
+static struct clk_mxc mpll_main1_clk = {
+ .clk = INIT_CLK_MXC(mpll_main1_clk),
.id = 0,
.parent = &mpll_clk,
.get_rate = get_rate_mpll_main,
@@ -451,23 +454,27 @@ static struct clk mpll_main1_clk = {
/* For i.MX27 TO2, it is the MPLL path 2 of ARM core
* It provides the clock source whose rate is same MPLL * 2 / 3
*/
-static struct clk mpll_main2_clk = {
+static struct clk_mxc mpll_main2_clk = {
+ .clk = INIT_CLK_MXC(mpll_main2_clk),
.id = 1,
.parent = &mpll_clk,
.get_rate = get_rate_mpll_main,
};
-static struct clk ahb_clk = {
+static struct clk_mxc ahb_clk = {
+ .clk = INIT_CLK_MXC(ahb_clk),
.parent = &mpll_main2_clk,
.get_rate = get_rate_ahb,
};
-static struct clk ipg_clk = {
+static struct clk_mxc ipg_clk = {
+ .clk = INIT_CLK_MXC(ipg_clk),
.parent = &ahb_clk,
.get_rate = get_rate_ipg,
};
-static struct clk cpu_clk = {
+static struct clk_mxc cpu_clk = {
+ .clk = INIT_CLK_MXC(cpu_clk),
.parent = &mpll_main2_clk,
.set_parent = clk_cpu_set_parent,
.round_rate = round_rate_cpu,
@@ -475,7 +482,8 @@ static struct clk cpu_clk = {
.set_rate = set_rate_cpu,
};
-static struct clk spll_clk = {
+static struct clk_mxc spll_clk = {
+ .clk = INIT_CLK_MXC(spll_clk),
.parent = &ckih_clk,
.get_rate = get_rate_spll,
.enable = clk_spll_enable,
@@ -486,12 +494,14 @@ static struct clk spll_clk = {
* the low frequency external clock reference
* Default case is 32.768kHz.
*/
-static struct clk ckil_clk = {
+static struct clk_mxc ckil_clk = {
+ .clk = INIT_CLK_MXC(ckil_clk),
.get_rate = get_rate_low_reference,
};
/* Output of frequency pre multiplier */
-static struct clk fpm_clk = {
+static struct clk_mxc fpm_clk = {
+ .clk = INIT_CLK_MXC(fpm_clk),
.parent = &ckil_clk,
.get_rate = get_rate_fpm,
};
@@ -500,7 +510,8 @@ static struct clk fpm_clk = {
#define PCCR1 CCM_PCCR1
#define DEFINE_CLOCK(name, i, er, es, gr, s, p) \
- static struct clk name = { \
+ static struct clk_mxc name = { \
+ .clk = INIT_CLK_MXC(name), \
.id = i, \
.enable_reg = er, \
.enable_shift = es, \
@@ -512,7 +523,8 @@ static struct clk fpm_clk = {
}
#define DEFINE_CLOCK1(name, i, er, es, getsetround, s, p) \
- static struct clk name = { \
+ static struct clk_mxc name = { \
+ .clk = INIT_CLK_MXC(name), \
.id = i, \
.enable_reg = er, \
.enable_shift = es, \
@@ -526,7 +538,7 @@ static struct clk fpm_clk = {
}
/* Forward declaration to keep the following list in order */
-static struct clk slcdc_clk1, sahara2_clk1, rtic_clk1, fec_clk1, emma_clk1,
+static struct clk_mxc slcdc_clk1, sahara2_clk1, rtic_clk1, fec_clk1, emma_clk1,
dma_clk1, lcdc_clk2, vpu_clk1;
/* All clocks we can gate through PCCRx in the order of PCCRx bits */
@@ -620,7 +632,7 @@ DEFINE_CLOCK1(csi_clk, 0, NULL, 0, parent, &csi_clk1, &per4_clk);
{ \
.dev_id = d, \
.con_id = n, \
- .clk = &c, \
+ .clk = &c.clk, \
},
static struct clk_lookup lookups[] = {
@@ -746,16 +758,16 @@ int __init mx27_clocks_init(unsigned long fref)
spll_clk.disable(&spll_clk);
/* enable basic clocks */
- clk_enable(&per1_clk);
- clk_enable(&gpio_clk);
- clk_enable(&emi_clk);
- clk_enable(&iim_clk);
+ clk_enable(&per1_clk.clk);
+ clk_enable(&gpio_clk.clk);
+ clk_enable(&emi_clk.clk);
+ clk_enable(&iim_clk.clk);
#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC)
- clk_enable(&uart1_clk);
+ clk_enable(&uart1_clk.clk);
#endif
- mxc_timer_init(&gpt1_clk, MX27_IO_ADDRESS(MX27_GPT1_BASE_ADDR),
+ mxc_timer_init(&gpt1_clk.clk, MX27_IO_ADDRESS(MX27_GPT1_BASE_ADDR),
MX27_INT_GPT1);
return 0;
diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c
index 2ed3ab1..3fc75dd 100644
--- a/arch/arm/plat-mxc/clock.c
+++ b/arch/arm/plat-mxc/clock.c
@@ -44,6 +44,131 @@
static LIST_HEAD(clocks);
static DEFINE_MUTEX(clocks_mutex);
+#ifdef CONFIG_USE_COMMON_STRUCT_CLK
+static int clk_mxc_enable(struct clk *clk)
+{
+ struct clk_mxc *clk_mxc = to_clk_mxc(clk);
+ int ret = 0;
+
+ if (clk_mxc->parent)
+ ret = clk_enable(&clk_mxc->parent->clk);
+
+ if (!ret && clk_mxc->secondary)
+ ret = clk_enable(&clk_mxc->secondary->clk);
+
+ if (!ret && clk_mxc->enable)
+ ret = clk_mxc->enable(clk_mxc);
+
+ return ret;
+}
+
+static void clk_mxc_disable(struct clk *clk)
+{
+ struct clk_mxc *clk_mxc = to_clk_mxc(clk);
+
+ if (clk_mxc->disable)
+ clk_mxc->disable(clk_mxc);
+
+ if (clk_mxc->secondary)
+ clk_disable(&clk_mxc->secondary->clk);
+
+ if (clk_mxc->parent)
+ clk_disable(&clk_mxc->parent->clk);
+}
+
+static unsigned long clk_mxc_get_rate(struct clk *clk)
+{
+ struct clk_mxc *clk_mxc = to_clk_mxc(clk);
+
+ if (clk_mxc->get_rate)
+ return clk_mxc->get_rate(clk_mxc);
+ else if (clk_mxc->parent)
+ return clk_get_rate(&clk_mxc->parent->clk);
+ else
+ return 0UL;
+}
+
+static long clk_mxc_round_rate(struct clk *clk, unsigned long rate)
+{
+ struct clk_mxc *clk_mxc = to_clk_mxc(clk);
+
+ if (clk_mxc->round_rate)
+ return clk_mxc->round_rate(clk_mxc, rate);
+
+ return 0L;
+}
+
+static int clk_mxc_set_rate(struct clk *clk, unsigned long rate)
+{
+ struct clk_mxc *clk_mxc = to_clk_mxc(clk);
+ int ret = -EINVAL;
+
+ if (clk_mxc->set_rate && rate != 0)
+ ret = clk_mxc->set_rate(clk_mxc, rate);
+
+ return ret;
+}
+
+static int clk_mxc_set_parent(struct clk *clk, struct clk *parent)
+{
+ struct clk_mxc *clk_mxc = to_clk_mxc(clk);
+ struct clk *old_parent = parent;
+ struct clk_mxc *parent_mxc = to_clk_mxc(parent);
+ int ret;
+
+ if (!clk_mxc->set_parent)
+ return -EINVAL;
+
+ if (clk->prepare_count) {
+ ret = clk_prepare(parent);
+ if (ret)
+ goto err_prepare_parent;
+ }
+
+ if (clk->enable_count) {
+ ret = clk_enable(parent);
+ if (ret)
+ goto err_enable_parent;
+ }
+
+ ret = clk_mxc->set_parent(clk_mxc, parent_mxc);
+ if (ret == 0) {
+ old_parent = &clk_mxc->parent->clk;
+ clk_mxc->parent = to_clk_mxc(parent);
+ }
+
+ if (clk->enable_count)
+ clk_disable(old_parent);
+err_enable_parent:
+
+ if (clk->prepare_count)
+ clk_unprepare(old_parent);
+err_prepare_parent:
+
+ return ret;
+}
+
+static struct clk *clk_mxc_get_parent(struct clk *clk)
+{
+ struct clk_mxc *clk_mxc = to_clk_mxc(clk);
+
+ if (clk_mxc->parent)
+ return &clk_mxc->parent->clk;
+
+ return NULL;
+}
+
+const struct clk_ops clk_mxc_ops = {
+ .enable = clk_mxc_enable,
+ .disable = clk_mxc_disable,
+ .get_rate = clk_mxc_get_rate,
+ .round_rate = clk_mxc_round_rate,
+ .set_rate = clk_mxc_set_rate,
+ .set_parent = clk_mxc_set_parent,
+ .get_parent = clk_mxc_get_parent,
+};
+#else
+
/*-------------------------------------------------------------------------
* Standard clock functions defined in include/linux/clk.h
*-------------------------------------------------------------------------*/
@@ -200,6 +325,8 @@ struct clk *clk_get_parent(struct clk *clk)
}
EXPORT_SYMBOL(clk_get_parent);
+#endif
+
/*
* Get the resulting clock rate from a PLL register value and the input
* frequency. PLLs with this register layout can at least be found on
diff --git a/arch/arm/plat-mxc/include/mach/clkdev.h b/arch/arm/plat-mxc/include/mach/clkdev.h
index 04b37a8..f663af3 100644
--- a/arch/arm/plat-mxc/include/mach/clkdev.h
+++ b/arch/arm/plat-mxc/include/mach/clkdev.h
@@ -1,7 +1,11 @@
#ifndef __ASM_MACH_CLKDEV_H
#define __ASM_MACH_CLKDEV_H
+#ifndef CONFIG_USE_COMMON_STRUCT_CLK
+
#define __clk_get(clk) ({ 1; })
#define __clk_put(clk) do { } while (0)
#endif
+
+#endif
diff --git a/arch/arm/plat-mxc/include/mach/clock.h b/arch/arm/plat-mxc/include/mach/clock.h
index 753a598..d8efa77 100644
--- a/arch/arm/plat-mxc/include/mach/clock.h
+++ b/arch/arm/plat-mxc/include/mach/clock.h
@@ -23,14 +23,24 @@
#ifndef __ASSEMBLY__
#include <linux/list.h>
+#include <linux/clk.h>
+
struct module;
-struct clk {
+#ifndef CONFIG_USE_COMMON_STRUCT_CLK
+#define clk_mxc clk
+#endif
+
+struct clk_mxc {
+#ifdef CONFIG_USE_COMMON_STRUCT_CLK
+ struct clk clk;
+#endif
+
int id;
/* Source clock this clk depends on */
- struct clk *parent;
+ struct clk_mxc *parent;
/* Secondary clock to enable/disable with this clock */
- struct clk *secondary;
+ struct clk_mxc *secondary;
/* Reference count of clock enable/disable */
__s8 usecount;
/* Register bit position for clock's enable/disable control. */
@@ -39,23 +49,27 @@ struct clk {
void __iomem *enable_reg;
u32 flags;
/* get the current clock rate (always a fresh value) */
- unsigned long (*get_rate) (struct clk *);
+ unsigned long (*get_rate) (struct clk_mxc *);
/* Function ptr to set the clock to a new rate. The rate must match a
supported rate returned from round_rate. Leave blank if clock is not
programmable */
- int (*set_rate) (struct clk *, unsigned long);
+ int (*set_rate) (struct clk_mxc *, unsigned long);
/* Function ptr to round the requested clock rate to the nearest
supported rate that is less than or equal to the requested rate. */
- unsigned long (*round_rate) (struct clk *, unsigned long);
+ unsigned long (*round_rate) (struct clk_mxc *, unsigned long);
/* Function ptr to enable the clock. Leave blank if clock can not
be gated. */
- int (*enable) (struct clk *);
+ int (*enable) (struct clk_mxc *);
/* Function ptr to disable the clock. Leave blank if clock can not
be gated. */
- void (*disable) (struct clk *);
+ void (*disable) (struct clk_mxc *);
/* Function ptr to set the parent clock of the clock. */
- int (*set_parent) (struct clk *, struct clk *);
+ int (*set_parent) (struct clk_mxc *, struct clk_mxc *);
};
+#define to_clk_mxc(_clk_mxc) container_of(_clk_mxc, struct clk_mxc, clk)
+
+extern const struct clk_ops clk_mxc_ops;
+#define INIT_CLK_MXC(name) INIT_CLK(name.clk, clk_mxc_ops)
int clk_register(struct clk *clk);
void clk_unregister(struct clk *clk);
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 0da0bb9..fbafcb6 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -47,7 +47,7 @@ int clk_enable(struct clk *clk)
unsigned long flags;
int ret = 0;
- WARN_ON(clk->prepare_count == 0);
+ WARN_ON_ONCE(clk->prepare_count == 0);
spin_lock_irqsave(&clk->enable_lock, flags);
if (clk->enable_count == 0 && clk->ops->enable)
--
1.7.2.3
^ permalink raw reply related
* Build failure on i.MX25 [Was: [PATCH] ARM: imx/mach-mx25_3ds: Use IMX_GPIO_NR instead of hard-coded values]
From: Uwe Kleine-König @ 2011-02-22 23:36 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298417053-14418-1-git-send-email-fabio.estevam@freescale.com>
Hello Fabio,
as you currently seem to work on i.MX25: My mx25_defconfig our
autobuilder tests each night currently fails on latest linus/master.
You don't happen to already have looked into that?
(I don't have looked either, just want to prevent duplicated work.)
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* Build failure on i.MX25 [Was: [PATCH] ARM: imx/mach-mx25_3ds: Use IMX_GPIO_NR instead of hard-coded values]
From: Fabio Estevam @ 2011-02-22 23:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110222233610.GJ22310@pengutronix.de>
Hi Uwe,
2011/2/22 Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>:
> Hello Fabio,
>
> as you currently seem to work on i.MX25: ?My mx25_defconfig our
> autobuilder tests each night currently fails on latest linus/master.
> You don't happen to already have looked into that?
>
> (I don't have looked either, just want to prevent duplicated work.)
I haven?t looked seen this build isssue yet. Today I built a iMX25
kernel using Sascha?s for-next tree and my own defconfig and this is
probably the reason I haven?t faced this problem.
Thanks,
Fabio Estevam
^ permalink raw reply
* [PATCH] MAINTAINERS: Update MSM maintainers
From: David Brown @ 2011-02-23 0:03 UTC (permalink / raw)
To: linux-arm-kernel
Remove Bryan Huntsman and Daniel Walker from the MSM maintainer list.
Signed-off-by: David Brown <davidb@codeaurora.org>
---
MAINTAINERS | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 6f99e12..c6c6f55 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -885,8 +885,6 @@ S: Supported
ARM/QUALCOMM MSM MACHINE SUPPORT
M: David Brown <davidb@codeaurora.org>
-M: Daniel Walker <dwalker@fifo99.com>
-M: Bryan Huntsman <bryanh@codeaurora.org>
L: linux-arm-msm at vger.kernel.org
F: arch/arm/mach-msm/
F: drivers/video/msm/
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply related
* [PATCH] msm: add single-wire serial bus interface (SSBI) driver
From: Daniel Walker @ 2011-02-23 0:10 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <AANLkTi=0Pxg09x8DdVDVy9Ur7r1dgB+4LM3q0hM4_8Rg@mail.gmail.com>
On Tue, 2011-02-22 at 12:47 -0800, Dima Zavin wrote:
> What is the problem leaving it under arch/arm/mach-msm?
Because it's a driver.
Daniel
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox