ARM: OMAP: dmtimers improvements.
Subsystems (10)
cover ARM: OMAP: dmtimers improvements.
I would like to use omap dmtimer for a PWM driver (for the backlight on my display).
But there are two difficulties.
Unfortunately Jon Hunter (who has helped me with dmtimers before) seems to have disappeared. So I guess I get to do it myself :-)
Following two patches make dmtimers more usable.
1/ allow the counter to be set even when the timer isn't counting. 2/ move the include file to a more useful location
Any help you can provide in getting these fixes upstream would be appreciated.
Thanks,
NeilBrown
---
NeilBrown (2):
ARM: OMAP2+: dmtimer: allow counter to be set at any time.
ARM: OMAP: move dmtimer.h from plat-omap/include/plat to include/linux
arch/arm/mach-omap1/pm.c | 2 arch/arm/mach-omap1/timer.c | 2 arch/arm/mach-omap2/omap_hwmod_2420_data.c | 2 arch/arm/mach-omap2/omap_hwmod_2430_data.c | 2 arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c | 2 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 2 arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 2 arch/arm/mach-omap2/omap_hwmod_54xx_data.c | 2 arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 2 arch/arm/mach-omap2/timer.c | 2 arch/arm/plat-omap/dmtimer.c | 11 - arch/arm/plat-omap/include/plat/dmtimer.h | 415 -------------------- drivers/media/rc/ir-rx51.c | 2 drivers/pwm/pwm-omap.c | 2 drivers/staging/tidspbridge/core/dsp-clock.c | 2 include/linux/omap-dmtimer.h | 415 ++++++++++++++++++++ 16 files changed, 434 insertions(+), 433 deletions(-) delete mode 100644 arch/arm/plat-omap/include/plat/dmtimer.h create mode 100644 include/linux/omap-dmtimer.h
Signature · 1 line
Signature
PATCH 1/2 ARM: OMAP2+: dmtimer: allow counter to be set at any time.
It is perfectly appropriate to set the counter register when the timer isn't running. The value set will be where the counter starts counting from.
--- arch/arm/plat-omap/dmtimer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
arch/arm/plat-omap/dmtimer.c +4 -3
@@ -752,15 +752,16 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_read_counter);int omap_dm_timer_write_counter (struct omap_dm_timer *timer,unsigned int value) { -if (unlikely (!timer ||pm_runtime_suspended (&timer->pdev->dev))) { -pr_err ("%s: timer not available or enabled.\n" , __func__); +if (unlikely (!timer))return -EINVAL ; - } + +omap_dm_timer_enable (timer);omap_dm_timer_write_reg (timer,OMAP_TIMER_COUNTER_REG , value);/* Save the context */ timer->context.tcrr = value; +omap_dm_timer_disable (timer);return 0 ; }EXPORT_SYMBOL_GPL (omap_dm_timer_write_counter);
PATCH 2/2 ARM: OMAP: move dmtimer.h from plat-omap/include/plat to include/linux
In reply to NeilBrownThis is no need for dmtimer.h to be in the 'plat' include directory, and it makes it hard to write drivers which use it (such as a PWM driver). So move it to linux/omap-dmtimer.h.
--- arch/arm/mach-omap1/pm.c | 2 arch/arm/mach-omap1/timer.c | 2 arch/arm/mach-omap2/omap_hwmod_2420_data.c | 2 arch/arm/mach-omap2/omap_hwmod_2430_data.c | 2 arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c | 2 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 2 arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 2 arch/arm/mach-omap2/omap_hwmod_54xx_data.c | 2 arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 2 arch/arm/mach-omap2/timer.c | 2 arch/arm/plat-omap/dmtimer.c | 4 arch/arm/plat-omap/include/plat/dmtimer.h | 415 -------------------- drivers/media/rc/ir-rx51.c | 2 drivers/pwm/pwm-omap.c | 2 drivers/staging/tidspbridge/core/dsp-clock.c | 2 include/linux/omap-dmtimer.h | 415 ++++++++++++++++++++ 16 files changed, 430 insertions(+), 430 deletions(-) delete mode 100644 arch/arm/plat-omap/include/plat/dmtimer.h create mode 100644 include/linux/omap-dmtimer.h
arch/arm/mach-omap1/pm.c +1 -1
@@ -55,7 +55,7 @@#include <mach/tc.h> #include <mach/mux.h> #include <linux/omap-dma.h> -#include <plat/dmtimer.h> +#include <linux/omap-dmtimer.h> #include <mach/irqs.h>
arch/arm/mach-omap1/timer.c +1 -1
@@ -29,7 +29,7 @@#include <mach/irqs.h> -#include <plat/dmtimer.h> +#include <linux/omap-dmtimer.h> #define OMAP1610_GPTIMER1_BASE 0xfffb1400#define OMAP1610_GPTIMER2_BASE 0xfffb1c00
arch/arm/mach-omap2/omap_hwmod_2420_data.c +1 -1
@@ -17,7 +17,7 @@#include <linux/platform_data/spi-omap2-mcspi.h> #include <linux/omap-dma.h> #include <linux/platform_data/mailbox-omap.h> -#include <plat/dmtimer.h> +#include <linux/omap-dmtimer.h> #include "omap_hwmod.h" #include "l3_2xxx.h"
arch/arm/mach-omap2/omap_hwmod_2430_data.c +1 -1
@@ -18,7 +18,7 @@#include <linux/platform_data/spi-omap2-mcspi.h> #include <linux/omap-dma.h> #include <linux/platform_data/mailbox-omap.h> -#include <plat/dmtimer.h> +#include <linux/omap-dmtimer.h> #include "omap_hwmod.h" #include "mmc.h"
arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c +1 -1
@@ -11,7 +11,7 @@#include <linux/platform_data/gpio-omap.h> #include <linux/omap-dma.h> -#include <plat/dmtimer.h> +#include <linux/omap-dmtimer.h> #include <linux/platform_data/spi-omap2-mcspi.h> #include "omap_hwmod.h"
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +1 -1
@@ -26,7 +26,7 @@#include <linux/platform_data/spi-omap2-mcspi.h> #include <linux/platform_data/iommu-omap.h> #include <linux/platform_data/mailbox-omap.h> -#include <plat/dmtimer.h> +#include <linux/omap-dmtimer.h> #include "am35xx.h"
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +1 -1
@@ -30,7 +30,7 @@#include <linux/platform_data/spi-omap2-mcspi.h> #include <linux/platform_data/asoc-ti-mcbsp.h> #include <linux/platform_data/iommu-omap.h> -#include <plat/dmtimer.h> +#include <linux/omap-dmtimer.h> #include "omap_hwmod.h" #include "omap_hwmod_common_data.h"
arch/arm/mach-omap2/omap_hwmod_54xx_data.c +1 -1
@@ -25,7 +25,7 @@#include <linux/omap-dma.h> #include <linux/platform_data/spi-omap2-mcspi.h> #include <linux/platform_data/asoc-ti-mcbsp.h> -#include <plat/dmtimer.h> +#include <linux/omap-dmtimer.h> #include "omap_hwmod.h" #include "omap_hwmod_common_data.h"
arch/arm/mach-omap2/omap_hwmod_7xx_data.c +1 -1
@@ -25,7 +25,7 @@#include <linux/omap-dma.h> #include <linux/platform_data/spi-omap2-mcspi.h> #include <linux/platform_data/asoc-ti-mcbsp.h> -#include <plat/dmtimer.h> +#include <linux/omap-dmtimer.h> #include "omap_hwmod.h" #include "omap_hwmod_common_data.h"
arch/arm/mach-omap2/timer.c +1 -1
@@ -49,7 +49,7 @@#include "omap_hwmod.h" #include "omap_device.h" #include <plat/counter-32k.h> -#include <plat/dmtimer.h> +#include <linux/omap-dmtimer.h> #include "omap-pm.h" #include "soc.h"
arch/arm/plat-omap/dmtimer.c +2 -2
@@ -46,7 +46,7 @@#include <linux/platform_device.h> #include <linux/platform_data/dmtimer-omap.h> -#include <plat/dmtimer.h> +#include <linux/omap-dmtimer.h> static u32 omap_reserved_systimers;static LIST_HEAD (omap_timer_list);
@@ -292,7 +292,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_request_specific);* @cap: Bit mask of capabilities to match * * Find a timer based upon capabilities bit mask. Callers of this function -* should use the definitions found in the plat/dmtimer.h file under the +* should use the definitions found in the linux/omap-dmtimer.h file under the * comment "timer capabilities used in hwmod database". Returns pointer to * timer handle on success and a NULL pointer on failure. */
arch/arm/plat-omap/include/plat/dmtimer.h deleted +0 -415
415 lines not on this page · raw message
drivers/media/rc/ir-rx51.c +1 -1
@@ -26,7 +26,7 @@#include <linux/sched.h> #include <linux/wait.h> -#include <plat/dmtimer.h> +#include <linux/omap-dmtimer.h> #include <plat/clock.h> #include <media/lirc.h>
drivers/pwm/pwm-omap.c +1 -1
@@ -26,7 +26,7 @@#include <linux/module.h> #include <linux/platform_data/omap-pwm.h> -#include <../arch/arm/plat-omap/include/plat/dmtimer.h> +#include <linux/omap-dmtimer.h> #define DM_TIMER_LOAD_MIN 0xFFFFFFFE
drivers/staging/tidspbridge/core/dsp-clock.c +1 -1
@@ -22,7 +22,7 @@/* ----------------------------------- Host OS */ #include <dspbridge/host_os.h> -#include <plat/dmtimer.h> +#include <linux/omap-dmtimer.h> #include <linux/platform_data/asoc-ti-mcbsp.h> /* ----------------------------------- DSP/BIOS Bridge */
include/linux/omap-dmtimer.h new file +415 -0
415 lines not on this page · raw message
Sorry for top posting .... Probably we should move the dmtimer to drivers/misc or create drivers/timer/ This has been pending for quite some time now....
Tony, what you say ?
________________________________________
From: linux-arm-kernel [linux-arm-kernel-bounces at lists.infradead.org] on behalf of NeilBrown [neilb at suse.de]
Sent: Thursday, October 24, 2013 2:57 AM
To: Tony Lindgren; Russell King
Cc: Belisko Marek; linux-omap at vger.kernel.org; linux-kernel at vger.kernel.org; linux-arm-kernel at lists.infradead.org; Dr. H. Nikolaus Schaller
Subject: [PATCH 0/2] ARM: OMAP: dmtimers improvements.
I would like to use omap dmtimer for a PWM driver (for the backlight on my display).
But there are two difficulties.
Unfortunately Jon Hunter (who has helped me with dmtimers before) seems to have disappeared. So I guess I get to do it myself :-)
Following two patches make dmtimers more usable.
1/ allow the counter to be set even when the timer isn't counting. 2/ move the include file to a more useful location
Any help you can provide in getting these fixes upstream would be appreciated.
Thanks,
NeilBrown
---
NeilBrown (2):
ARM: OMAP2+: dmtimer: allow counter to be set at any time.
ARM: OMAP: move dmtimer.h from plat-omap/include/plat to include/linux
arch/arm/mach-omap1/pm.c | 2 arch/arm/mach-omap1/timer.c | 2 arch/arm/mach-omap2/omap_hwmod_2420_data.c | 2 arch/arm/mach-omap2/omap_hwmod_2430_data.c | 2 arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c | 2 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 2 arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 2 arch/arm/mach-omap2/omap_hwmod_54xx_data.c | 2 arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 2 arch/arm/mach-omap2/timer.c | 2 arch/arm/plat-omap/dmtimer.c | 11 - arch/arm/plat-omap/include/plat/dmtimer.h | 415 -------------------- drivers/media/rc/ir-rx51.c | 2 drivers/pwm/pwm-omap.c | 2 drivers/staging/tidspbridge/core/dsp-clock.c | 2 include/linux/omap-dmtimer.h | 415 ++++++++++++++++++++ 16 files changed, 434 insertions(+), 433 deletions(-) delete mode 100644 arch/arm/plat-omap/include/plat/dmtimer.h create mode 100644 include/linux/omap-dmtimer.h
--
Signature
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Tony Lindgren
maintainerQuoted 4 lines · Shilimkar, Santosh
Sorry for top posting .... Probably we should move the dmtimer to
drivers/miscor createdrivers/timer/This has been pending for quite some time now....Tony, what you say ?
Yes that should be done and we should cc Thomas Gleixner to see if he has any better ideas for some of those exported functions. Things that can be done with hrtimer should be done with hrtimer, but at least the coprocessor use of timers and PWM need to use timers directly.
Regards,
Tony