* [PATCH 7/8] ARM: dts: AM33XX: Add PWMSS device tree nodes
From: Philip, Avinash @ 2012-11-05 9:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352106749-9437-1-git-send-email-avinashphilip@ti.com>
Add PWMSS device tree nodes in relation with ECAP & EHRPWM DT nodes to
AM33XX SoC family. Also populates device tree nodes for ECAP & EHRPWM by
adding necessary properties like pwm-cells, base reg & set disabled as
status.
Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
---
Second version
- Combined with HWMOD changes & DT bindings.
- Handling Parent<-> child relation ship for PWM subsystem
:100644 100644 bb31bff... cf5e049... M arch/arm/boot/dts/am33xx.dtsi
arch/arm/boot/dts/am33xx.dtsi | 90 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 90 insertions(+), 0 deletions(-)
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index bb31bff..cf5e049 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -210,5 +210,95 @@
interrupt-parent = <&intc>;
interrupts = <91>;
};
+
+ epwmss0: epwmss at 48300000 {
+ compatible = "ti,am33xx-pwmss";
+ reg = <0x48300000 0x10
+ 0x48300100 0x80
+ 0x48300180 0x80
+ 0x48300200 0x80>;
+ ti,hwmods = "epwmss0";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ status = "disabled";
+ ranges;
+
+ ecap0: ecap at 48300100 {
+ compatible = "ti,am33xx-ecap";
+ #pwm-cells = <3>;
+ reg = <0x48300100 0x80>;
+ ti,hwmods = "ecap0";
+ status = "disabled";
+ };
+
+ ehrpwm0: ehrpwm at 48300200 {
+ compatible = "ti,am33xx-ehrpwm";
+ #pwm-cells = <3>;
+ reg = <0x48300200 0x80>;
+ ti,hwmods = "ehrpwm0";
+ status = "disabled";
+ tbclkgating;
+ };
+ };
+
+ epwmss1: epwmss at 48302000 {
+ compatible = "ti,am33xx-pwmss";
+ reg = <0x48302000 0x10
+ 0x48302100 0x80
+ 0x48302180 0x80
+ 0x48302200 0x80>;
+ ti,hwmods = "epwmss1";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ status = "disabled";
+ ranges;
+
+ ecap1: ecap at 48302100 {
+ compatible = "ti,am33xx-ecap";
+ #pwm-cells = <3>;
+ reg = <0x48302100 0x80>;
+ ti,hwmods = "ecap1";
+ status = "disabled";
+ };
+
+ ehrpwm1: ehrpwm at 48302200 {
+ compatible = "ti,am33xx-ehrpwm";
+ #pwm-cells = <3>;
+ reg = <0x48302200 0x80>;
+ ti,hwmods = "ehrpwm1";
+ status = "disabled";
+ tbclkgating;
+ };
+ };
+
+ epwmss2: epwmss at 48304000 {
+ compatible = "ti,am33xx-pwmss";
+ reg = <0x48304000 0x10
+ 0x48304100 0x80
+ 0x48304180 0x80
+ 0x48304200 0x80>;
+ ti,hwmods = "epwmss2";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ status = "disabled";
+ ranges;
+
+ ecap2: ecap at 48304100 {
+ compatible = "ti,am33xx-ecap";
+ #pwm-cells = <3>;
+ reg = <0x48304100 0x80>;
+ ti,hwmods = "ecap2";
+ status = "disabled";
+ };
+
+ ehrpwm2: ehrpwm at 48304200 {
+ compatible = "ti,am33xx-ehrpwm";
+ #pwm-cells = <3>;
+ reg = <0x48304200 0x80>;
+ ti,hwmods = "ehrpwm2";
+ status = "disabled";
+ tbclkgating;
+ };
+ };
};
};
--
1.7.0.4
^ permalink raw reply related
* [PATCH 8/8] ARM: dts: AM33XX: Add PWM backlight DT data to am335x-evm
From: Philip, Avinash @ 2012-11-05 9:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352106749-9437-1-git-send-email-avinashphilip@ti.com>
PWM output from ecap0 uses as backlight source. Also adds low threshold
value to have a uniform divisions in brightness-levels scales.
Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
---
Second version
- Combined with HWMOD changes & DT bindings.
- No changes
:100644 100644 185d632... 9857050... M arch/arm/boot/dts/am335x-evm.dts
arch/arm/boot/dts/am335x-evm.dts | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 185d632..9857050 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -18,6 +18,14 @@
reg = <0x80000000 0x10000000>; /* 256 MB */
};
+ am33xx_pinmux: pinmux at 44e10800 {
+ ecap0_pins: backlight_pins {
+ pinctrl-single,pins = <
+ 0x164 0x0 /* eCAP0_in_PWM0_out.eCAP0_in_PWM0_out MODE0 */
+ >;
+ };
+ };
+
ocp {
uart1: serial at 44e09000 {
status = "okay";
@@ -31,6 +39,12 @@
reg = <0x2d>;
};
};
+
+ ecap0: ecap at 48300100 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&ecap0_pins>;
+ };
};
vbat: fixedregulator at 0 {
@@ -40,6 +54,13 @@
regulator-max-microvolt = <5000000>;
regulator-boot-on;
};
+
+ backlight {
+ compatible = "pwm-backlight";
+ pwms = <&ecap0 0 50000 0>;
+ brightness-levels = <0 51 53 56 62 75 101 152 255>;
+ default-brightness-level = <8>;
+ };
};
/include/ "tps65910.dtsi"
--
1.7.0.4
^ permalink raw reply related
* scheduler clock for MXS [Was: Re: Wakeup latency measured with SCHED_TRACER depends on HZ]
From: Stanislav Meduna @ 2012-11-05 9:14 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121105025753.GA26528@S2100-06.ap.freescale.net>
On 05.11.2012 03:57, Shawn Guo wrote:
>> The patch in attach fixes this. I can only test the MX28 part -
>> I don't have any timrot_is_v1() (MX23) hardware and I don't
>> know whether a source that wraps after ~2 seconds is OK at all.
>
> From my quick testing on imx23 with printk timestamp, it's not OK,
> so we may need to leave imx23 out there.
Hmm, does it wrap after 2 seconds? From my grepping and googling
the code should now adapt itself, the hardcoded limit is gone...
What does the dmesg line such as
sched_clock: 32 bits at 32kHz, resolution 31250ns,
wraps every 134217727ms
output on that hardware?
Thanks for the comments, I will resubmit the corrected patch after
waiting ~1,5 days to verify correct wrapping with MX28.
Regards
--
Stano
^ permalink raw reply
* ARM: idle sleep time for hotplugged cpu
From: Russell King - ARM Linux @ 2012-11-05 9:15 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <50973842.9010708@codeaurora.org>
On Mon, Nov 05, 2012 at 09:23:38AM +0530, Taniya Das wrote:
> I was looking at the arch/arm/process.c:cpu_die, I was wondering why we
> do not exit from NOHZ for a hotplugged/offline cpu?
Offlined CPUs are not supposed to just 'return' from cpu_die(), and
in actual fact they can't.
^ permalink raw reply
* [PATCHv2 1/7] i2c: omap: Fix the revision register read
From: Shubhrajyoti Datta @ 2012-11-05 9:24 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121105090412.GA2913@arwen.pp.htv.fi>
On Mon, Nov 5, 2012 at 2:34 PM, Felipe Balbi <balbi@ti.com> wrote:
> Hi,
>
> On Mon, Nov 05, 2012 at 02:04:56PM +0530, Shubhrajyoti wrote:
> > >> @@ -1155,7 +1187,7 @@ omap_i2c_probe(struct platform_device *pdev)
> > >>
> > >> dev->fifo_size = (dev->fifo_size / 2);
> > >>
> > >> - if (dev->rev < OMAP_I2C_REV_ON_3630_4430)
> > >> + if (dev->rev < OMAP_I2C_REV_ON_3630)
> > >> dev->b_hw = 1; /* Enable hardware fixes */
> > > looks like this was applicable to 4430 too, what happened ?
> > No actually this can be deleted completely once the
> > start -> transaction -> stop sequence recommendation is followed.
>
> yes, but we're not there just yet and this patch is changing the
> behavior of the driver
No , earlier we were truncating the register for omap4 so
OMAP_I2C_REV_ON_3630_4430 was there if we read both hi and lo for
omap4 then we donot find 3630 and 4430 value to be similar.
In this case the behavior is same as earlier also it enabled this for lower
than 3630 and
the same holds good even now.
So in essence,
Earlier OMAP_I2C_REV_ON_3630_4430 is named to OMAP_I2C_REV_ON_3630
and omap4 rev will have a 32bit value.
> in ways which don't belong to $SUBJECT.
>
> --
> balbi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121105/a7c816f2/attachment-0001.html>
^ permalink raw reply
* [GIT PULL] kill plat-nomadik and convert Nomadik+Ux500 to SPARSE_IRQ
From: Linus Walleij @ 2012-11-05 9:25 UTC (permalink / raw)
To: linux-arm-kernel
Hi ARM SoC maintainers,
this pull request will move all headers away from plat-nomadik, move the
timer driver to drivers/clocksource, delete plat-nomadik and then convert
Nomadik and Ux500 to SPARSE_IRQ. I consider this a big piece of
cleanup that we need to move ahead with single zImage.
As discussed with Arnd in Copenhagen here is a pull request including a few
patches that are for obvious reasons also in the pinctrl tree. We will have
to fix this up in the merge window as the end result is the removal of the
plat-nomadik directory which means there will be massive collissions if we
try to pretend the changes are orthogonal.
The patches have all been circulated to relevant subsystem maintainers,
but I have not recieved an ACK from Samuel Ortiz, Mike Turquette yet,
nor from the clocksource maintainer.
However they have had time to review the patches and they're basically
only changing #include <> statements and so I think we should move ahead
with this anyway. I'm a bit uncertain about the clocksource though, it should
be straight-forward.
Waiting for weeks for ACKs before being able to merge to ARM SoC
will delay any linux-next testing which slows down everything :-(
Signed tag per below.
Yours,
Linus Walleij
The following changes since commit 8f0d8163b50e01f398b14bcd4dc039ac5ab18d64:
Linux 3.7-rc3 (2012-10-28 12:24:48 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git
tags/kill-plat-sparse-irq
for you to fetch changes up to c3b9d1db23c4ebd4d8a0964ebcf5f27d4eb8fa3f:
ARM: plat-nomadik: convert platforms to SPARSE_IRQ (2012-11-05 09:55:34 +0100)
----------------------------------------------------------------
This patchset will:
- Move all remaining headers out of arch/arm/plat-nomadik/include/plat
out to e.g. include/linux/platform_data
- Delete arch/arm/plat-nomadik
- Convert Nomadik and Ux500 to SPARSE_IRQ
----------------------------------------------------------------
Linus Walleij (10):
pinctrl/nomadik: move the platform data header
pinctrl/nomadik: merge old pincfg header
clk/ux500: explicitly include register header
ARM: plat-nomadik: pass IRQ to timer driver
ARM: plat-nomadik: use DIV_ROUND_CLOSEST()
ARM: plat-nomadik: move DMA40 header to <linux/platform_data>
ARM: plat-nomadik: move MTU, kill plat-nomadik
mfd/ab8500-core: use irq_domain_add_simple()
mfd/db8500-prcmu: use the irq_domain_add_simple()
ARM: plat-nomadik: convert platforms to SPARSE_IRQ
Maxime Coquelin (1):
ARM: plat-nomadik: Introduce new DB8540 GPIO registers
Patrice Chotard (1):
ARM: plat-nomadik: move NMK_GPIO_PER_CHIP into gpio-nomadik.h
arch/arm/Kconfig | 3 +-
arch/arm/Makefile | 1 -
arch/arm/mach-nomadik/Kconfig | 2 +-
arch/arm/mach-nomadik/board-nhk8815.c | 13 +--
arch/arm/mach-nomadik/cpu-8815.c | 2 +-
arch/arm/mach-nomadik/i2c-8815nhk.c | 3 +-
arch/arm/mach-nomadik/include/mach/irqs.h | 2 +-
arch/arm/mach-ux500/Kconfig | 2 +-
arch/arm/mach-ux500/board-mop500-audio.c | 6 +-
arch/arm/mach-ux500/board-mop500-pins.c | 3 +-
arch/arm/mach-ux500/board-mop500-sdi.c | 2 +-
arch/arm/mach-ux500/board-mop500.c | 6 +-
arch/arm/mach-ux500/cpu-db8500.c | 5 +-
arch/arm/mach-ux500/devices-common.c | 4 +-
arch/arm/mach-ux500/devices-db8500.c | 4 +-
arch/arm/mach-ux500/devices-db8500.h | 1 +
arch/arm/mach-ux500/include/mach/irqs.h | 2 +-
arch/arm/mach-ux500/include/mach/msp.h | 2 +-
arch/arm/mach-ux500/timer.c | 5 +-
arch/arm/mach-ux500/usb.c | 4 +-
arch/arm/plat-nomadik/Kconfig | 29 ------
arch/arm/plat-nomadik/Makefile | 5 -
arch/arm/plat-nomadik/include/plat/gpio-nomadik.h | 102 -------------------
drivers/char/hw_random/Kconfig | 2 +-
drivers/clk/ux500/u8500_clk.c | 2 +-
drivers/clocksource/Kconfig | 17 +++-
drivers/clocksource/Makefile | 1 +
.../timer.c => drivers/clocksource/nomadik-mtu.c | 11 +-
drivers/crypto/ux500/cryp/cryp_core.c | 3 +-
drivers/dma/ste_dma40.c | 3 +-
drivers/dma/ste_dma40_ll.c | 2 +-
drivers/input/keyboard/Kconfig | 2 +-
drivers/mfd/ab8500-core.c | 13 +--
drivers/mfd/db8500-prcmu.c | 12 ++-
drivers/mtd/nand/Kconfig | 2 +-
drivers/pinctrl/pinctrl-nomadik.c | 11 +-
drivers/pinctrl/pinctrl-nomadik.h | 2 +-
.../linux/platform_data/clocksource-nomadik-mtu.h | 2 +-
include/linux/platform_data/crypto-ux500.h | 2 +-
.../linux/platform_data/dma-ste-dma40.h | 0
.../linux/platform_data/pinctrl-nomadik.h | 111 +++++++++++++++++++--
sound/soc/ux500/ux500_pcm.c | 3 +-
42 files changed, 184 insertions(+), 225 deletions(-)
delete mode 100644 arch/arm/plat-nomadik/Kconfig
delete mode 100644 arch/arm/plat-nomadik/Makefile
delete mode 100644 arch/arm/plat-nomadik/include/plat/gpio-nomadik.h
rename arch/arm/plat-nomadik/timer.c => drivers/clocksource/nomadik-mtu.c (95%)
rename arch/arm/plat-nomadik/include/plat/mtu.h =>
include/linux/platform_data/clocksource-nomadik-mtu.h (71%)
rename arch/arm/plat-nomadik/include/plat/ste_dma40.h =>
include/linux/platform_data/dma-ste-dma40.h (100%)
rename arch/arm/plat-nomadik/include/plat/pincfg.h =>
include/linux/platform_data/pinctrl-nomadik.h (66%)
^ permalink raw reply
* [PATCHv2 3/7] i2c: omap: remove the dtrev
From: Shubhrajyoti @ 2012-11-05 9:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121105090517.GB2913@arwen.pp.htv.fi>
On Monday 05 November 2012 02:35 PM, Felipe Balbi wrote:
>> egister map is different.
>> >
>> > So the scheme may still be required.
> fair enough, but drop it from debugging messages.
OK thanks.
^ permalink raw reply
* OMAP baseline test results for v3.7-rc1
From: Jean Pihet @ 2012-11-05 9:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <alpine.DEB.2.00.1211050313130.23228@utopia.booyaka.com>
Paul,
On Mon, Nov 5, 2012 at 4:15 AM, Paul Walmsley <paul@pwsan.com> wrote:
> Hi Jean,
>
> On Sat, 3 Nov 2012, Jean Pihet wrote:
>
>> The setup is as identical as possible to yours:
>> - U-Boot 2011.06-dirty (Sep 04 2012 - 17:06:58) from
>> http://www.pwsan.com/tmp/3530es3beagle-MLO-u-boot-20121023.tar.bz2.
>> Please note that the MLO image does not run on my board and so I had
>> to use my known-to-work image.
>
> Interesting...
>
>> The result is that I could reproduce the issue but it happens much
>> more rarely on my side (only once vs quasi 100% on ~50 boot cycles).
>
> Hmm...
>
>> The issue is triggered by running 'hwclock --systohc' while the
>> system is heavily loaded (running depmod etc.).
>
> OK.
>
>> More investigation on-going, so more to come!
>
> Great, keep us posted.
I ran some intensive stress tests on the I2C and ... unfortunately I
could not trigger the problem. It looks like the issue is caused by
some transient situation where the CORE and/or I2C is in a low power
state.
Here are the tests that have been performed from the user space:
- stress test the I2C IRQ handler by reading and writing the RTC, and
checking the amount of IRQs for the I2C bus. In that case the CORE
never goes in low power mode,
- stress test the CORE low power and wake-up transition by adjusting
the autosuspend delay (e.g.
/sys/devices/platform/omap_i2c.1/power/autosuspend_delay_ms) and
accessing the RTC after the CORE has gone in low power.
Those tests have been run for hours (>200000 IRQs) and the I2C timeout
issue could not be observed. The target low power mode is RET (not
tried with OFF).
The next step is to detect an error situation and have data logged
about the state at that moment. What do you think?
This brings an interesting discussion. As you indicated earlier,
withtout CPU_IDLE enabled nothing except the autosuspend delay is
preventing the power domains to go in low power mode. This could lead
to situations where latency constraints are not respected. The easy
and straight forward solution is to enable CPU_IDLE and use the PM QoS
constraints.
What do you think?
Regards,
Jean
>
> Will try to kick off those tests you requested within the next 24-48
> hours.
>
>
> - Paul
^ permalink raw reply
* [PATCH 1/1 v2] usb: at91_udc: fix typo on vubs pullup valid check
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-11-05 9:34 UTC (permalink / raw)
To: linux-arm-kernel
if the gpio is not valid complain
since 3285e0ec088febc5a88f57ddd78385a7da71476c
ARM: at91/udc: use gpio_is_valid to check the gpio
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: linux-usb at vger.kernel.org
Cc: stable at vger.kernel.org
Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
---
v2:
update commit and put Felipe in Cc
Hi Greg,
this is broken since 3.2 can we have on the stable too
Best Regards,
J.
drivers/usb/gadget/at91_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 89d90b5..888cb2a 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1739,7 +1739,7 @@ static int __devinit at91udc_probe(struct platform_device *pdev)
/* rm9200 needs manual D+ pullup; off by default */
if (cpu_is_at91rm9200()) {
- if (gpio_is_valid(udc->board.pullup_pin)) {
+ if (!gpio_is_valid(udc->board.pullup_pin)) {
DBG("no D+ pullup?\n");
retval = -ENODEV;
goto fail0;
--
1.7.10.4
^ permalink raw reply related
* vexpress issues in next-20121029
From: Russell King - ARM Linux @ 2012-11-05 9:35 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1351613819.6199.14.camel@hornet>
On Tue, Oct 30, 2012 at 04:16:59PM +0000, Pawel Moll wrote:
> Hi Stephen,
>
> On Mon, 2012-10-29 at 20:24 +0000, Stephen Warren wrote:
> > 1) At compile-time: v2m_timer_init() and v2m_dt_timer_init() reference
> > functions vexpress_clk_init() and vexpress_clk_of_init() respectively,
> > which don't appear anywhere in the source tree.
>
> There was a glitch between clk-next and arm-soc - it should be fine
> starting with next-20121030.
The problem is still there - my builds of my tree plus arm-soc are
continuing to fail with:
arch/arm/mach-vexpress/built-in.o: In function `v2m_timer_init':
reset.c:(.init.text+0xe0): undefined reference to `vexpress_clk_init'
arch/arm/mach-vexpress/built-in.o: In function `v2m_dt_timer_init':
reset.c:(.init.text+0x114): undefined reference to `vexpress_clk_of_init'
My guess is you have a dependency between the clk-next tree and arm-soc
which you haven't told the arm-soc people about.
^ permalink raw reply
* [PATCH 1/2] leds: Add generic support for memory mapped LEDs
From: Jon Medhurst (Tixy) @ 2012-11-05 9:39 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1351792722-15250-1-git-send-email-pawel.moll@arm.com>
On Thu, 2012-11-01 at 17:58 +0000, Pawel Moll wrote:
> LEDs are often controlled by writing to memory mapped
> register. This patch adds:
>
> 1. Generic functions for platform code and drivers to create
> class device for LEDs controlled by arbitrary bit masks.
> The control register value is read, modified by logic AND
> and OR operations with respective mask and written back.
>
> 2. A platform driver for simple use case when one or more LED
> are controlled by consecutive bits in a register pointed
> at by the platform device's memory resource. It can be
> particularly useful for MFD cells being part of an other
> device.
>
> Signed-off-by: Pawel Moll <pawel.moll@arm.com>
> ---
> drivers/leds/Kconfig | 8 ++
> drivers/leds/Makefile | 1 +
> drivers/leds/leds-mmio.c | 250 ++++++++++++++++++++++++++++++++++++++++++++++
> include/linux/leds.h | 38 +++++++
> 4 files changed, 297 insertions(+)
> create mode 100644 drivers/leds/leds-mmio.c
>
> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> index f508def..93707e6 100644
> --- a/drivers/leds/Kconfig
> +++ b/drivers/leds/Kconfig
> @@ -457,6 +457,14 @@ config LEDS_BLINKM
> This option enables support for the BlinkM RGB LED connected
> through I2C. Say Y to enable support for the BlinkM LED.
>
> +config LEDS_MMIO
> + tristate "Generic LED support for memory mapped peripherals"
> + depends on LEDS_CLASS
> + depends on HAS_IOMEM
> + help
> + This option enables generic support for LEDs controlled via
> + memory mapped registers.
> +
> config LEDS_TRIGGERS
> bool "LED Trigger support"
> depends on LEDS_CLASS
> diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
> index 3fb9641..8e5d0c8 100644
> --- a/drivers/leds/Makefile
> +++ b/drivers/leds/Makefile
> @@ -51,6 +51,7 @@ obj-$(CONFIG_LEDS_RENESAS_TPU) += leds-renesas-tpu.o
> obj-$(CONFIG_LEDS_MAX8997) += leds-max8997.o
> obj-$(CONFIG_LEDS_LM355x) += leds-lm355x.o
> obj-$(CONFIG_LEDS_BLINKM) += leds-blinkm.o
> +obj-$(CONFIG_LEDS_MMIO) += leds-mmio.o
>
> # LED SPI Drivers
> obj-$(CONFIG_LEDS_DAC124S085) += leds-dac124s085.o
> diff --git a/drivers/leds/leds-mmio.c b/drivers/leds/leds-mmio.c
> new file mode 100644
> index 0000000..1ef0cda
> --- /dev/null
> +++ b/drivers/leds/leds-mmio.c
> @@ -0,0 +1,250 @@
> +/*
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * 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.
> + *
> + * Copyright (C) 2012 ARM Limited
> + */
> +
> +#include <linux/err.h>
> +#include <linux/io.h>
> +#include <linux/kernel.h>
> +#include <linux/leds.h>
> +#include <linux/mfd/core.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
> +#include <linux/slab.h>
> +
> +
> +static u32 mmio_led_read(void __iomem *reg, unsigned reg_size)
> +{
> + switch (reg_size) {
> + case 32:
> + return readl(reg);
> + case 16:
> + return readw(reg);
> + case 8:
> + return readb(reg);
> + }
> + return 0;
> +}
> +
> +static void mmio_led_write(void __iomem *reg, unsigned reg_size, u32 val)
> +{
> + switch (reg_size) {
> + case 32:
> + writel(val, reg);
> + return;
> + case 16:
> + writew(val, reg);
> + return;
> + case 8:
> + writeb(val, reg);
> + return;
> + }
> +}
> +
> +
> +struct mmio_led {
> + struct led_classdev cdev;
> + spinlock_t *lock;
> + void __iomem *reg;
> + unsigned reg_size;
> + u32 off_and_mask, off_or_mask;
> + u32 on_and_mask, on_or_mask;
> +};
> +
> +static void mmio_led_brightness_set(struct led_classdev *cdev,
> + enum led_brightness brightness)
> +{
> + struct mmio_led *led = container_of(cdev, struct mmio_led, cdev);
> + unsigned long uninitialized_var(flags);
uninitialized_var seems to be a bit contentious, Linus Torvalds had a
recent complaint about it which prompted Ingo to post a patch proposing
to removing it: https://patchwork.kernel.org/patch/1655621/ So perhaps
best to avoid using it ;-).
In this case, you could possibly keep gcc quite with something like:
spinlock_t *lock = led->lock;
and then use the local variable 'lock' everywhere instead of led->lock.
Or just keep it simple an initialise flags to 0 instead.
> + u32 val;
> +
> + if (led->lock)
> + spin_lock_irqsave(led->lock, flags);
> +
> + val = mmio_led_read(led->reg, led->reg_size);
> + if (brightness == LED_OFF) {
> + val &= led->off_and_mask;
> + val |= led->off_or_mask;
> + } else {
> + val &= led->on_and_mask;
> + val |= led->on_or_mask;
> + }
> + mmio_led_write(led->reg, led->reg_size, val);
> +
> + if (led->lock)
> + spin_unlock_irqrestore(led->lock, flags);
> +};
> +
> +static enum led_brightness mmio_led_brightness_get(struct led_classdev *cdev)
> +{
> + struct mmio_led *led = container_of(cdev, struct mmio_led, cdev);
> + unsigned long uninitialized_var(flags);
Same comment as previous.
> + u32 val;
> +
> + if (led->lock)
> + spin_lock_irqsave(led->lock, flags);
> + val = mmio_led_read(led->reg, led->reg_size);
> + if (led->lock)
> + spin_unlock_irqrestore(led->lock, flags);
> +
> + if (((val & led->on_and_mask) | led->on_or_mask) == val)
> + return LED_FULL;
> + else
> + return LED_OFF;
> +}
> +
> +struct mmio_led *mmio_led_register(struct device *parent, spinlock_t *lock,
> + const char *name, const char *default_trigger,
> + void __iomem *reg, unsigned reg_size, u32 off_and_mask,
> + u32 off_or_mask, u32 on_and_mask, u32 on_or_mask)
> +{
> + struct mmio_led *led;
> + int err;
> +
> + if (WARN_ON(reg_size != 8 && reg_size != 16 && reg_size != 32))
> + return ERR_PTR(-EINVAL);
> +
> + led = kzalloc(sizeof(*led), GFP_KERNEL);
> + if (!led)
> + return ERR_PTR(-ENOMEM);
> +
> + led->cdev.brightness_set = mmio_led_brightness_set;
> + led->cdev.brightness_get = mmio_led_brightness_get;
> + led->cdev.name = name;
> + led->cdev.default_trigger = default_trigger;
> +
> + led->lock = lock;
> + led->reg = reg;
> + led->reg_size = reg_size;
> + led->off_and_mask = off_and_mask;
> + led->off_or_mask = off_or_mask;
> + led->on_and_mask = on_and_mask;
> + led->on_or_mask = on_or_mask;
> +
> + err = led_classdev_register(parent, &led->cdev);
> + if (err) {
> + kfree(led);
> + return ERR_PTR(err);
> + }
> +
> + return led;
> +}
> +EXPORT_SYMBOL_GPL(mmio_led_register);
> +
> +void mmio_led_unregister(struct mmio_led *led)
> +{
> + led_classdev_unregister(&led->cdev);
> + kfree(led);
> +}
> +EXPORT_SYMBOL_GPL(mmio_led_unregister);
> +
> +
> +struct mmio_simple_leds {
> + spinlock_t lock;
> + int num_leds;
> + struct mmio_led *leds[0];
> +};
> +
> +static int __devinit mmio_simple_leds_probe(struct platform_device *pdev)
> +{
> + struct mmio_simple_leds_platform_data *pdata = pdev->dev.platform_data;
> + struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + struct mmio_simple_leds *leds;
> + void __iomem *reg;
> + u32 val, mask;
> + int i;
> +
> + if (!pdata)
> + return -EINVAL;
> +
> + if (pdata->reg_size != 8 && pdata->reg_size != 16 &&
> + pdata->reg_size != 32)
> + return -EFAULT;
Is EFAULT appropriate here? Why not EINVAL?
> + leds = devm_kzalloc(&pdev->dev, sizeof(*leds) +
> + sizeof(leds->leds) * pdata->width, GFP_KERNEL);
> + if (!leds)
> + return -ENOMEM;
> + spin_lock_init(&leds->lock);
> +
> + if ((!pdev->mfd_cell || !pdev->mfd_cell->ignore_resource_conflicts) &&
> + !devm_request_mem_region(&pdev->dev, res->start,
> + resource_size(res), pdev->name))
> + return -EBUSY;
> +
> + reg = devm_ioremap(&pdev->dev, res->start, resource_size(res));
> + if (!reg)
> + return -ENOMEM;
> +
> + val = mmio_led_read(reg, pdata->reg_size);
> + mask = ((1 << pdata->width) - 1) << pdata->shift;
> + if ((pdata->init_full && pdata->active_low) ||
> + (pdata->init_off && !pdata->active_low))
> + val &= ~mask;
> + else if ((pdata->init_off && pdata->active_low) ||
> + (pdata->init_full && !pdata->active_low))
> + val |= mask;
> + mmio_led_write(reg, pdata->reg_size, val);
> +
> + leds->num_leds = pdata->width;
> + for (i = 0; i < leds->num_leds; i++) {
> + unsigned shift = pdata->shift + i;
> + u32 and_mask = ~BIT(shift);
> + u32 off_or_mask = pdata->active_low ? BIT(shift) : 0;
> + u32 on_or_mask = pdata->active_low ? 0 : BIT(shift);
> + struct mmio_led *led = mmio_led_register(&pdev->dev,
> + &leds->lock, pdata->names[i],
> + pdata->default_triggers ?
> + pdata->default_triggers[i] : NULL,
> + reg, pdata->reg_size, and_mask, off_or_mask,
> + and_mask, on_or_mask);
> +
> + if (IS_ERR(led)) {
> + while (--i >= 0)
> + mmio_led_unregister(leds->leds[i]);
> + return PTR_ERR(led);
> + }
> + leds->leds[i] = led;
> + }
> +
> + platform_set_drvdata(pdev, leds);
> +
> + return 0;
> +}
> +
> +static int __devexit mmio_simple_leds_remove(struct platform_device *pdev)
> +{
> + struct mmio_simple_leds *leds = platform_get_drvdata(pdev);
> + int i;
> +
> + platform_set_drvdata(pdev, NULL);
> +
> + for (i = 0; i < leds->num_leds; i++)
> + mmio_led_unregister(leds->leds[i]);
> +
> + return 0;
> +}
> +
> +static struct platform_driver mmio_simple_leds_driver = {
> + .probe = mmio_simple_leds_probe,
> + .remove = __devexit_p(mmio_simple_leds_remove),
> + .driver = {
> + .name = "leds-mmio-simple",
> + .owner = THIS_MODULE,
> + },
> +};
> +
> +module_platform_driver(mmio_simple_leds_driver);
> +
> +MODULE_AUTHOR("Pawel Moll <pawel.moll@arm.com>");
> +MODULE_DESCRIPTION("MMIO LED driver");
> +MODULE_LICENSE("GPL");
> +MODULE_ALIAS("platform:leds-mmio-simple");
> diff --git a/include/linux/leds.h b/include/linux/leds.h
> index 6e53bb3..a6338b0 100644
> --- a/include/linux/leds.h
> +++ b/include/linux/leds.h
> @@ -241,6 +241,44 @@ struct gpio_led_platform_data {
> struct platform_device *gpio_led_register_device(
> int id, const struct gpio_led_platform_data *pdata);
>
> +/* For the leds-mmio driver */
> +
> +struct mmio_led;
> +
> +#if defined(CONFIG_LEDS_MMIO)
> +/* Returns ERR_PTR in case of error */
> +struct mmio_led *mmio_led_register(struct device *parent, spinlock_t *lock,
> + const char *name, const char *default_trigger,
> + void __iomem *reg, unsigned reg_size, u32 off_and_mask,
> + u32 off_or_mask, u32 on_and_mask, u32 on_or_mask);
> +void mmio_led_unregister(struct mmio_led *led);
> +#else
> +struct mmio_led *mmio_led_register(struct device *parent, spinlock_t *lock,
> + const char *name, const char *default_trigger,
> + void __iomem *reg, unsigned reg_size, u32 off_and_mask,
> + u32 off_or_mask, u32 on_and_mask, u32 on_or_mask)
> +{
> + return NULL;
> +}
> +
> +void mmio_led_unregister(struct mmio_led *led)
> +{
> +}
> +#endif
> +
> +struct mmio_simple_leds_platform_data {
> + unsigned reg_size; /* Register size (8/16/32) */
> + unsigned shift; /* First bit controlling LEDs */
> + unsigned width; /* Number of consecutive bits */
> + const char **names; /* Must define 'width' names */
> + const char **default_triggers; /* NULL or 'width' strings */
> + bool active_low;
> + bool init_full;
> + bool init_off;
> +};
> +
> +/* CPU led trigger */
> +
> enum cpu_led_event {
> CPU_LED_IDLE_START, /* CPU enters idle */
> CPU_LED_IDLE_END, /* CPU idle ends */
--
Tixy
^ permalink raw reply
* [PATCHv2 1/7] i2c: omap: Fix the revision register read
From: Shubhrajyoti Datta @ 2012-11-05 9:40 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121105090412.GA2913@arwen.pp.htv.fi>
On Mon, Nov 5, 2012 at 2:34 PM, Felipe Balbi <balbi@ti.com> wrote:
> Hi,
>
> On Mon, Nov 05, 2012 at 02:04:56PM +0530, Shubhrajyoti wrote:
>> >> @@ -1155,7 +1187,7 @@ omap_i2c_probe(struct platform_device *pdev)
>> >>
>> >> dev->fifo_size = (dev->fifo_size / 2);
>> >>
>> >> - if (dev->rev < OMAP_I2C_REV_ON_3630_4430)
>> >> + if (dev->rev < OMAP_I2C_REV_ON_3630)
>> >> dev->b_hw = 1; /* Enable hardware fixes */
>> > looks like this was applicable to 4430 too, what happened ?
>> No actually this can be deleted completely once the
>> start -> transaction -> stop sequence recommendation is followed.
>
> yes, but we're not there just yet and this patch is changing the
> behavior
No , earlier we were truncating the register for omap4 so
OMAP_I2C_REV_ON_3630_4430 was there if we read both hi and lo for
omap4 then we donot find 3630 and 4430 value to be similar.
In this case the behavior is same as earlier also it enabled this for
lower than 3630 and
the same holds good even now.
So in essence,
Earlier OMAP_I2C_REV_ON_3630_4430 is named to OMAP_I2C_REV_ON_3630
and omap4 rev will have a 32bit value which is greater.
> of the driver in ways which don't belong to $SUBJECT.
>
> --
> balbi
^ permalink raw reply
* [PATCH 1/1 v2] usb: at91_udc: fix typo on vubs pullup valid check
From: Russell King - ARM Linux @ 2012-11-05 9:42 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121105093451.GA20063@game.jcrosoft.org>
Subject: usb: at91_udc: fix typo on vubs pullup valid check
^^^^
typo.
On Mon, Nov 05, 2012 at 10:34:52AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> if the gpio is not valid complain
>
> since 3285e0ec088febc5a88f57ddd78385a7da71476c
> ARM: at91/udc: use gpio_is_valid to check the gpio
Poor description.
"The check for a valid vbus pullup gpio in commit 3285e0ec088f (ARM: at91/udc:
use gpio_is_valid to check the gpio) is inverted. Fix this."
would be much better because it describes what the the actual problem is.
Your description could mean that it's missing the error return path, or
maybe you're adding a log message to the failure case, or...
^ permalink raw reply
* [PATCH 0/4] pm: Add power off control
From: AnilKumar Ch @ 2012-11-05 9:42 UTC (permalink / raw)
To: linux-arm-kernel
Add PM power_off control to rtc driver, along with this PMIC status
is set to STATUS_OFF to shutdown PMIC if PWR_EN is toggled by RTC
module.
System power off sequence:-
* Set PMIC STATUS_OFF when PMIC_POWER_EN is pulled low
* Enable PMIC_POWER_EN in rtc module
* Set rtc ALARM2 time
* Enable ALARM2 interrupt
These patches were tested on AM335x-Bone.
AnilKumar Ch (2):
ARM: dts: AM33XX: Set pmic-shutdown-controller for BeagleBone
ARM: dts: AM33XX: Enable system power off control in am335x-bone
Colin Foe-Parker (2):
mfd: tps65217: Set PMIC to shutdowm on PWR_EN toggle
rtc: OMAP: Add system pm_power_off to rtc driver
.../devicetree/bindings/regulator/tps65217.txt | 4 +
Documentation/devicetree/bindings/rtc/rtc-omap.txt | 5 ++
arch/arm/boot/dts/am335x-bone.dts | 6 ++
drivers/mfd/tps65217.c | 12 +++
drivers/rtc/rtc-omap.c | 79 +++++++++++++++++++-
5 files changed, 105 insertions(+), 1 deletion(-)
--
1.7.9.5
^ permalink raw reply
* [PATCH 1/4] mfd: tps65217: Set PMIC to shutdowm on PWR_EN toggle
From: AnilKumar Ch @ 2012-11-05 9:42 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352108549-9341-1-git-send-email-anilkumar@ti.com>
From: Colin Foe-Parker <colin.foeparker@logicpd.com>
Set tps65217 PMIC status to OFF if power enable toggle is
supported. Also adds platform data flag, which should be
passed from board init data.
Signed-off-by: Colin Foe-Parker <colin.foeparker@logicpd.com>
[anilkumar at ti.com: move the additions to tps65217 MFD driver]
Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
---
.../devicetree/bindings/regulator/tps65217.txt | 4 ++++
drivers/mfd/tps65217.c | 12 ++++++++++++
2 files changed, 16 insertions(+)
diff --git a/Documentation/devicetree/bindings/regulator/tps65217.txt b/Documentation/devicetree/bindings/regulator/tps65217.txt
index d316fb8..4f05d20 100644
--- a/Documentation/devicetree/bindings/regulator/tps65217.txt
+++ b/Documentation/devicetree/bindings/regulator/tps65217.txt
@@ -11,6 +11,9 @@ Required properties:
using the standard binding for regulators found at
Documentation/devicetree/bindings/regulator/regulator.txt.
+Optional properties:
+- ti,pmic-shutdown-controller: Telling the PMIC to shutdown on PWR_EN toggle.
+
The valid names for regulators are:
tps65217: dcdc1, dcdc2, dcdc3, ldo1, ldo2, ldo3 and ldo4
@@ -20,6 +23,7 @@ Example:
tps: tps at 24 {
compatible = "ti,tps65217";
+ ti,pmic-shutdown-controller;
regulators {
dcdc1_reg: dcdc1 {
diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
index 3fb32e6..c7f17d8 100644
--- a/drivers/mfd/tps65217.c
+++ b/drivers/mfd/tps65217.c
@@ -160,6 +160,7 @@ static int __devinit tps65217_probe(struct i2c_client *client,
unsigned int version;
unsigned int chip_id = ids->driver_data;
const struct of_device_id *match;
+ bool status_off = false;
int ret;
if (client->dev.of_node) {
@@ -170,6 +171,8 @@ static int __devinit tps65217_probe(struct i2c_client *client,
return -EINVAL;
}
chip_id = (unsigned int)match->data;
+ status_off = of_property_read_bool(client->dev.of_node,
+ "ti,pmic-shutdown-controller");
}
if (!chip_id) {
@@ -207,6 +210,15 @@ static int __devinit tps65217_probe(struct i2c_client *client,
return ret;
}
+ /* Set the PMIC to shutdown on PWR_EN toggle */
+ if (status_off) {
+ ret = tps65217_set_bits(tps, TPS65217_REG_STATUS,
+ TPS65217_STATUS_OFF, TPS65217_STATUS_OFF,
+ TPS65217_PROTECT_NONE);
+ if (ret)
+ dev_warn(tps->dev, "unable to set the status OFF\n");
+ }
+
dev_info(tps->dev, "TPS65217 ID %#x version 1.%d\n",
(version & TPS65217_CHIPID_CHIP_MASK) >> 4,
version & TPS65217_CHIPID_REV_MASK);
--
1.7.9.5
^ permalink raw reply related
* [PATCH 2/4] rtc: OMAP: Add system pm_power_off to rtc driver
From: AnilKumar Ch @ 2012-11-05 9:42 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352108549-9341-1-git-send-email-anilkumar@ti.com>
From: Colin Foe-Parker <colin.foeparker@logicpd.com>
Add system power off control to rtc driver which is the in-charge
of controlling the BeagleBone system power. The power_off routine
can be hooked up to "pm_power_off" system call.
System power off sequence:-
* Set PMIC STATUS_OFF when PMIC_POWER_EN is pulled low
* Enable PMIC_POWER_EN in rtc module
* Set rtc ALARM2 time
* Enable ALARM2 interrupt
Added while (1); after the above steps to make sure that no other
process acquire cpu. Otherwise we might see an unexpected behaviour
because we are shutting down all the power rails of SoC except RTC.
Signed-off-by: Colin Foe-Parker <colin.foeparker@logicpd.com>
[anilkumar at ti.com: move poweroff additions to rtc driver]
Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
---
Documentation/devicetree/bindings/rtc/rtc-omap.txt | 5 ++
drivers/rtc/rtc-omap.c | 79 +++++++++++++++++++-
2 files changed, 83 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/rtc/rtc-omap.txt b/Documentation/devicetree/bindings/rtc/rtc-omap.txt
index b47aa41..8d9f4f9 100644
--- a/Documentation/devicetree/bindings/rtc/rtc-omap.txt
+++ b/Documentation/devicetree/bindings/rtc/rtc-omap.txt
@@ -6,6 +6,10 @@ Required properties:
- interrupts: rtc timer, alarm interrupts in order
- interrupt-parent: phandle for the interrupt controller
+Optional properties:
+- ti,system-power-controller: Telling whether or not rtc is controlling
+ the system power.
+
Example:
rtc at 1c23000 {
@@ -14,4 +18,5 @@ rtc at 1c23000 {
interrupts = <19
19>;
interrupt-parent = <&intc>;
+ ti,system-power-controller;
};
diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index 6009714..2d90170 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -72,6 +72,14 @@
#define OMAP_RTC_KICK0_REG 0x6c
#define OMAP_RTC_KICK1_REG 0x70
+#define OMAP_RTC_ALARM2_SECONDS_REG 0x80
+#define OMAP_RTC_ALARM2_MINUTES_REG 0x84
+#define OMAP_RTC_ALARM2_HOURS_REG 0x88
+#define OMAP_RTC_ALARM2_DAYS_REG 0x8c
+#define OMAP_RTC_ALARM2_MONTHS_REG 0x90
+#define OMAP_RTC_ALARM2_YEARS_REG 0x94
+#define OMAP_RTC_PMIC_REG 0x98
+
/* OMAP_RTC_CTRL_REG bit fields: */
#define OMAP_RTC_CTRL_SPLIT (1<<7)
#define OMAP_RTC_CTRL_DISABLE (1<<6)
@@ -93,15 +101,24 @@
#define OMAP_RTC_STATUS_BUSY (1<<0)
/* OMAP_RTC_INTERRUPTS_REG bit fields: */
+#define OMAP_RTC_INTERRUPTS_IT_ALARM2 (1<<4)
#define OMAP_RTC_INTERRUPTS_IT_ALARM (1<<3)
#define OMAP_RTC_INTERRUPTS_IT_TIMER (1<<2)
+/* OMAP_RTC_PMIC_REG bit fields: */
+#define OMAP_RTC_PMIC_POWER_EN_EN (1<<16)
+
/* OMAP_RTC_KICKER values */
#define KICK0_VALUE 0x83e70b13
#define KICK1_VALUE 0x95a4f1e0
#define OMAP_RTC_HAS_KICKER 0x1
+#define SHUTDOWN_TIME_SEC 2
+#define SECS_IN_MIN 60
+#define WAIT_AFTER (SECS_IN_MIN - SHUTDOWN_TIME_SEC)
+#define WAIT_TIME_MS (SHUTDOWN_TIME_SEC * 1000)
+
static void __iomem *rtc_base;
#define rtc_read(addr) readb(rtc_base + (addr))
@@ -290,6 +307,58 @@ static int omap_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
return 0;
}
+/*
+ * rtc_power_off: Set the pmic power off sequence. The RTC generates
+ * pmic_pwr_enable control, which can be used to control an external
+ * PMIC.
+ */
+static void rtc_power_off(void)
+{
+ u32 val;
+ struct rtc_time tm;
+ spinlock_t lock;
+ unsigned long flags;
+
+ spin_lock_init(&lock);
+
+ /* Set PMIC power enable */
+ val = readl(rtc_base + OMAP_RTC_PMIC_REG);
+ writel(val | OMAP_RTC_PMIC_POWER_EN_EN, rtc_base + OMAP_RTC_PMIC_REG);
+
+ /* Wait few seconds instead of rollover */
+ do {
+ omap_rtc_read_time(NULL, &tm);
+ if (WAIT_AFTER <= tm.tm_sec)
+ mdelay(WAIT_TIME_MS);
+ } while (WAIT_AFTER <= tm.tm_sec);
+
+ /* Add shutdown time to the current value */
+ tm.tm_sec += SHUTDOWN_TIME_SEC;
+
+ if (tm2bcd(&tm) < 0)
+ return;
+
+ pr_info("System will go to power_off state in approx. %d secs\n",
+ SHUTDOWN_TIME_SEC);
+
+ /* Set the ALARM2 time */
+ rtc_write(tm.tm_sec, OMAP_RTC_ALARM2_SECONDS_REG);
+ rtc_write(tm.tm_min, OMAP_RTC_ALARM2_MINUTES_REG);
+ rtc_write(tm.tm_hour, OMAP_RTC_ALARM2_HOURS_REG);
+ rtc_write(tm.tm_mday, OMAP_RTC_ALARM2_DAYS_REG);
+ rtc_write(tm.tm_mon, OMAP_RTC_ALARM2_MONTHS_REG);
+ rtc_write(tm.tm_year, OMAP_RTC_ALARM2_YEARS_REG);
+
+ /* Enable alarm2 interrupt */
+ val = readl(rtc_base + OMAP_RTC_INTERRUPTS_REG);
+ writel(val | OMAP_RTC_INTERRUPTS_IT_ALARM2,
+ rtc_base + OMAP_RTC_INTERRUPTS_REG);
+
+ /* Do not allow to execute any other task */
+ spin_lock_irqsave(&lock, flags);
+ while (1);
+}
+
static struct rtc_class_ops omap_rtc_ops = {
.read_time = omap_rtc_read_time,
.set_time = omap_rtc_set_time,
@@ -327,12 +396,16 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
struct resource *res, *mem;
struct rtc_device *rtc;
u8 reg, new_ctrl;
+ bool pm_off = false;
const struct platform_device_id *id_entry;
const struct of_device_id *of_id;
of_id = of_match_device(omap_rtc_of_match, &pdev->dev);
- if (of_id)
+ if (of_id) {
pdev->id_entry = of_id->data;
+ pm_off = of_property_read_bool(pdev->dev.of_node,
+ "ti,system-power-controller");
+ }
omap_rtc_timer = platform_get_irq(pdev, 0);
if (omap_rtc_timer <= 0) {
@@ -385,6 +458,10 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, rtc);
dev_set_drvdata(&rtc->dev, mem);
+ /* RTC power off */
+ if (pm_off && !pm_power_off)
+ pm_power_off = rtc_power_off;
+
/* clear pending irqs, and set 1/second periodic,
* which we'll use instead of update irqs
*/
--
1.7.9.5
^ permalink raw reply related
* [PATCH 3/4] ARM: dts: AM33XX: Set pmic-shutdown-controller for BeagleBone
From: AnilKumar Ch @ 2012-11-05 9:42 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352108549-9341-1-git-send-email-anilkumar@ti.com>
Set ti,pmic-shutdown-controller for BeagleBone in am335x-bone.dts
file, this flag is used by the driver to set tps65217 PMIC status
to OFF when PWR_EN toggle.
Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
---
arch/arm/boot/dts/am335x-bone.dts | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts
index 91eee97..40ea3c7 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -44,6 +44,8 @@
/include/ "tps65217.dtsi"
&tps {
+ ti,pmic-shutdown-controller;
+
regulators {
dcdc1_reg: regulator at 0 {
regulator-always-on;
--
1.7.9.5
^ permalink raw reply related
* [PATCH 4/4] ARM: dts: AM33XX: Enable system power off control in am335x-bone
From: AnilKumar Ch @ 2012-11-05 9:42 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352108549-9341-1-git-send-email-anilkumar@ti.com>
Enable system power off control for BeagleBone in am335x-bone.dts file
under rtc node. RTC is the incharge of controlling the system power.
This flag is used by the driver to hook up the pm_power_off system call.
Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
---
arch/arm/boot/dts/am335x-bone.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts
index 40ea3c7..6f9c48e 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -38,6 +38,10 @@
};
};
+
+ rtc at 44e3e000 {
+ ti,system-power-controller;
+ };
};
};
--
1.7.9.5
^ permalink raw reply related
* vexpress issues in next-20121029
From: Russell King - ARM Linux @ 2012-11-05 9:45 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121105093532.GC28327@n2100.arm.linux.org.uk>
On Mon, Nov 05, 2012 at 09:35:32AM +0000, Russell King - ARM Linux wrote:
> On Tue, Oct 30, 2012 at 04:16:59PM +0000, Pawel Moll wrote:
> > Hi Stephen,
> >
> > On Mon, 2012-10-29 at 20:24 +0000, Stephen Warren wrote:
> > > 1) At compile-time: v2m_timer_init() and v2m_dt_timer_init() reference
> > > functions vexpress_clk_init() and vexpress_clk_of_init() respectively,
> > > which don't appear anywhere in the source tree.
> >
> > There was a glitch between clk-next and arm-soc - it should be fine
> > starting with next-20121030.
>
> The problem is still there - my builds of my tree plus arm-soc are
> continuing to fail with:
>
> arch/arm/mach-vexpress/built-in.o: In function `v2m_timer_init':
> reset.c:(.init.text+0xe0): undefined reference to `vexpress_clk_init'
> arch/arm/mach-vexpress/built-in.o: In function `v2m_dt_timer_init':
> reset.c:(.init.text+0x114): undefined reference to `vexpress_clk_of_init'
>
> My guess is you have a dependency between the clk-next tree and arm-soc
> which you haven't told the arm-soc people about.
Oh, and the above seems to affect all my kautobuilds for any ARM Ltd
development platform - it's not just vexpress which is affected by this
anymore.
^ permalink raw reply
* [PATCHv2 1/7] i2c: omap: Fix the revision register read
From: Felipe Balbi @ 2012-11-05 10:01 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAM=Q2csb_9ryaZfURqv6QgsVuSRiVMDt=x=Adko2HH4GoiHnCQ@mail.gmail.com>
Hi,
On Mon, Nov 05, 2012 at 02:54:32PM +0530, Shubhrajyoti Datta wrote:
> On Mon, Nov 5, 2012 at 2:34 PM, Felipe Balbi <balbi@ti.com> wrote:
>
> > Hi,
> >
> > On Mon, Nov 05, 2012 at 02:04:56PM +0530, Shubhrajyoti wrote:
> > > >> @@ -1155,7 +1187,7 @@ omap_i2c_probe(struct platform_device *pdev)
> > > >>
> > > >> dev->fifo_size = (dev->fifo_size / 2);
> > > >>
> > > >> - if (dev->rev < OMAP_I2C_REV_ON_3630_4430)
> > > >> + if (dev->rev < OMAP_I2C_REV_ON_3630)
> > > >> dev->b_hw = 1; /* Enable hardware fixes */
> > > > looks like this was applicable to 4430 too, what happened ?
> > > No actually this can be deleted completely once the
> > > start -> transaction -> stop sequence recommendation is followed.
> >
> > yes, but we're not there just yet and this patch is changing the
> > behavior of the driver
>
>
> No , earlier we were truncating the register for omap4 so
> OMAP_I2C_REV_ON_3630_4430 was there if we read both hi and lo for
> omap4 then we donot find 3630 and 4430 value to be similar.
>
> In this case the behavior is same as earlier also it enabled this for
> lower than 3630 and the same holds good even now.
>
> So in essence, Earlier OMAP_I2C_REV_ON_3630_4430 is named to
> OMAP_I2C_REV_ON_3630 and omap4 rev will have a 32bit value.
it's not same behavior because before dev->b_hw was set for omap4430,
but now it won't be. This is the difference in behavior which I'm
pointing out.
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121105/a9193efb/attachment.sig>
^ permalink raw reply
* [PATCH] ARM: OMAP4: ID: Improve features detection and check
From: Ivan Khoronzhuk @ 2012-11-05 10:16 UTC (permalink / raw)
To: linux-arm-kernel
Replaces several flags bearing the same meaning. There is no need
to set flags due to different omap types here, it can be checked
in appropriate places as well.
Cc: Tony Lindgren <tony@atomide.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-omap at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
Acked-by: Nishanth Menon <nm@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
---
arch/arm/mach-omap2/id.c | 25 +++++++------------------
arch/arm/mach-omap2/soc.h | 8 ++------
2 files changed, 9 insertions(+), 24 deletions(-)
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index cf2362c..3c47a19 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -28,6 +28,9 @@
#include "soc.h"
#include "control.h"
+#define OMAP4_SILICON_TYPE_STANDARD 0x01
+#define OMAP4_SILICON_TYPE_PERFORMANCE 0x02
+
static unsigned int omap_revision;
static const char *cpu_rev;
u32 omap_features;
@@ -273,25 +276,11 @@ void __init omap4xxx_check_features(void)
{
u32 si_type;
- if (cpu_is_omap443x())
- omap_features |= OMAP4_HAS_MPU_1GHZ;
-
+ si_type =
+ (read_tap_reg(OMAP4_CTRL_MODULE_CORE_STD_FUSE_PROD_ID_1) >> 16) & 0x03;
- if (cpu_is_omap446x()) {
- si_type =
- read_tap_reg(OMAP4_CTRL_MODULE_CORE_STD_FUSE_PROD_ID_1);
- switch ((si_type & (3 << 16)) >> 16) {
- case 2:
- /* High performance device */
- omap_features |= OMAP4_HAS_MPU_1_5GHZ;
- break;
- case 1:
- default:
- /* Standard device */
- omap_features |= OMAP4_HAS_MPU_1_2GHZ;
- break;
- }
- }
+ if (si_type == OMAP4_SILICON_TYPE_PERFORMANCE)
+ omap_features = OMAP4_HAS_PERF_SILICON;
}
void __init ti81xx_check_features(void)
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index 0700964..f31d907 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -435,9 +435,7 @@ extern u32 omap_features;
#define OMAP3_HAS_IO_WAKEUP BIT(6)
#define OMAP3_HAS_SDRC BIT(7)
#define OMAP3_HAS_IO_CHAIN_CTRL BIT(8)
-#define OMAP4_HAS_MPU_1GHZ BIT(9)
-#define OMAP4_HAS_MPU_1_2GHZ BIT(10)
-#define OMAP4_HAS_MPU_1_5GHZ BIT(11)
+#define OMAP4_HAS_PERF_SILICON BIT(9)
#define OMAP3_HAS_FEATURE(feat,flag) \
@@ -465,9 +463,7 @@ static inline unsigned int omap4_has_ ##feat(void) \
return omap_features & OMAP4_HAS_ ##flag; \
} \
-OMAP4_HAS_FEATURE(mpu_1ghz, MPU_1GHZ)
-OMAP4_HAS_FEATURE(mpu_1_2ghz, MPU_1_2GHZ)
-OMAP4_HAS_FEATURE(mpu_1_5ghz, MPU_1_5GHZ)
+OMAP4_HAS_FEATURE(perf_silicon, PERF_SILICON)
#endif /* __ASSEMBLY__ */
--
1.7.9.5
^ permalink raw reply related
* [PATCH 0/9] Pinctrl: SPEAr: Fixes for 3.7-rc3
From: Linus Walleij @ 2012-11-05 10:38 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <cover.1351329224.git.viresh.kumar@linaro.org>
On Sat, Oct 27, 2012 at 11:17 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> Hi Linus,
>
> This patchset fixes many errors/mistakes in current pinctrl configurations for
> various SPEAr SoCs. Please see if they can be merged in next rc release, if they
> look fine to you.
First sorry for taking so long...
Basically I have a hard time believeing these are regressions.
I have applied patch 1, 2, 3 and 5 to fixes but I want an argument
of why patch 4 and 6-9 are causing regressions in the current
mainline kernel.
I suspect they are fixing regressions in a non-mainline kernel
which is none of our business, but convince me and I'll move
them to the fixes branch ... I have still merged them, but aimed
for v3.8.
Yours,
Linus Walleij
^ permalink raw reply
* [PATCHv2 1/7] i2c: omap: Fix the revision register read
From: Felipe Balbi @ 2012-11-05 10:45 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121105100105.GC3327@arwen.pp.htv.fi>
Hi,
On Mon, Nov 05, 2012 at 12:01:05PM +0200, Felipe Balbi wrote:
> Hi,
>
> On Mon, Nov 05, 2012 at 02:54:32PM +0530, Shubhrajyoti Datta wrote:
> > On Mon, Nov 5, 2012 at 2:34 PM, Felipe Balbi <balbi@ti.com> wrote:
> >
> > > Hi,
> > >
> > > On Mon, Nov 05, 2012 at 02:04:56PM +0530, Shubhrajyoti wrote:
> > > > >> @@ -1155,7 +1187,7 @@ omap_i2c_probe(struct platform_device *pdev)
> > > > >>
> > > > >> dev->fifo_size = (dev->fifo_size / 2);
> > > > >>
> > > > >> - if (dev->rev < OMAP_I2C_REV_ON_3630_4430)
> > > > >> + if (dev->rev < OMAP_I2C_REV_ON_3630)
> > > > >> dev->b_hw = 1; /* Enable hardware fixes */
> > > > > looks like this was applicable to 4430 too, what happened ?
> > > > No actually this can be deleted completely once the
> > > > start -> transaction -> stop sequence recommendation is followed.
> > >
> > > yes, but we're not there just yet and this patch is changing the
> > > behavior of the driver
> >
> >
> > No , earlier we were truncating the register for omap4 so
> > OMAP_I2C_REV_ON_3630_4430 was there if we read both hi and lo for
> > omap4 then we donot find 3630 and 4430 value to be similar.
> >
> > In this case the behavior is same as earlier also it enabled this for
> > lower than 3630 and the same holds good even now.
> >
> > So in essence, Earlier OMAP_I2C_REV_ON_3630_4430 is named to
> > OMAP_I2C_REV_ON_3630 and omap4 rev will have a 32bit value.
>
> it's not same behavior because before dev->b_hw was set for omap4430,
> but now it won't be. This is the difference in behavior which I'm
> pointing out.
what I said is nonsense, since b_hw was set for anything older than
3630, so current code is no different.
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121105/e48c95b2/attachment.sig>
^ permalink raw reply
* [PATCH 00/10] ARM: dts: AM33XX: Add device tree data
From: AnilKumar Ch @ 2012-11-05 10:45 UTC (permalink / raw)
To: linux-arm-kernel
Add device tree date for GPIO based various drivers matrix keypad,
volume keys, push buttons and use leds accross three AM33XX devices
viz EVM, BeagleBone and Starter Kit.
To make it functional this series also adds pinctrl data for all
the GPIOs used by various drivers. In this series only default state
pinmux/conf settings are added because of sleep/idle state pinctrl
values are not available.
These patches are based on linux-omap-dt:for_3.8/dts tree and these
were tested on am33xx devices according to added functionality.
AnilKumar Ch (10):
ARM: dts: AM33XX: Add pinmux configuration for matrix keypad to EVM
ARM: dts: AM33XX: Add matrix keypad device tree data to am335x-evm
ARM: dts: AM33XX: Add pinmux configuration for volume-keys to EVM
ARM: dts: AM33XX: Add volume-keys device tree data to am335x-evm
ARM: dts: AM33XX: Add pinmux configuration for user-leds to BONE
ARM: dts: AM33XX: Add user-leds device tree data to am335x-bone
ARM: dts: AM33XX: Add pinmux configuration for gpio-leds to EVMSK
ARM: dts: AM33XX: Add user-leds device tree data to am335x-evmsk
ARM: dts: AM33XX: Add pinmux configuration for gpio-keys to EVMSK
ARM: dts: AM33XX: Add push-buttons device tree data to am335x-evmsk
arch/arm/boot/dts/am335x-bone.dts | 44 +++++++++++++++++++
arch/arm/boot/dts/am335x-evm.dts | 63 +++++++++++++++++++++++++++
arch/arm/boot/dts/am335x-evmsk.dts | 84 ++++++++++++++++++++++++++++++++++++
3 files changed, 191 insertions(+)
--
1.7.9.5
^ permalink raw reply
* [PATCH 01/10] ARM: dts: AM33XX: Add pinmux configuration for matrix keypad to EVM
From: AnilKumar Ch @ 2012-11-05 10:45 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352112350-13398-1-git-send-email-anilkumar@ti.com>
Add pinmux configurations for gpio matrix keypad. In this patch, only
single named mode/state is added and these pins are configured during
pinctrl driver initialization.
Default mode is nothing but the values required for the module during
active state. With this configurations module is functional as
expected.
Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
---
arch/arm/boot/dts/am335x-evm.dts | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 513284f..9199456 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -24,6 +24,21 @@
reg = <0x80000000 0x10000000>; /* 256 MB */
};
+ am33xx_pinmux: pinmux at 44e10800 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&matrix_keypad_s0>;
+
+ matrix_keypad_s0: matrix_keypad_s0 {
+ pinctrl-single,pins = <
+ 0x54 0x7 /* gpmc_a5.gpio1_21, OUTPUT | MODE7 */
+ 0x58 0x7 /* gpmc_a6.gpio1_22, OUTPUT | MODE7 */
+ 0x64 0x27 /* gpmc_a9.gpio1_25, INPUT | MODE7 */
+ 0x68 0x27 /* gpmc_a10.gpio1_26, INPUT | MODE7 */
+ 0x6c 0x27 /* gpmc_a11.gpio1_27, INPUT | MODE7 */
+ >;
+ };
+ };
+
ocp {
uart1: serial at 44e09000 {
status = "okay";
--
1.7.9.5
^ permalink raw reply related
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