public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Santosh Shilimkar <santosh.shilimkar@ti.com>
To: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH v13 11/11] OMAP: dmtimer: convert to a driver
Date: Fri, 29 Apr 2011 16:21:45 +0530	[thread overview]
Message-ID: <4DBA9841.1080508@ti.com> (raw)
In-Reply-To: <1302969063-8231-12-git-send-email-tarun.kanti@ti.com>

Tarun,

On 4/16/2011 9:21 PM, Tarun Kanti DebBarma wrote:
> Make plat-omap/dmtimer.c a normal driver. It is moved to drivers/misc
> as timer-omap.c and the corresponding header file has been moved to
> include/linux as timer-omap.h. Files which included plat/dmtimer.h
> are changed to include linux/timer-omap.h now.
>
> Signed-off-by: Tarun Kanti DebBarma<tarun.kanti@ti.com>
> ---
>   arch/arm/mach-omap1/dmtimer.c              |    3 +-
>   arch/arm/mach-omap1/pm.c                   |    2 +-
>   arch/arm/mach-omap1/timer32k.c             |    2 +-
>   arch/arm/mach-omap2/omap_hwmod_2420_data.c |    3 +-
>   arch/arm/mach-omap2/omap_hwmod_2430_data.c |    3 +-
>   arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |    3 +-
>   arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    2 +-
>   arch/arm/mach-omap2/pm-debug.c             |    2 +-
>   arch/arm/mach-omap2/timer.c                |    2 +-
>   arch/arm/plat-omap/Makefile                |    1 -
>   drivers/misc/Makefile                      |    1 +
>   drivers/misc/timer-omap.c                  |  643 ++++++++++++++++++++++++++++
>   drivers/tty/serial/omap-serial.c           |    2 +-
>   include/linux/timer-omap.h                 |  351 +++++++++++++++
>   14 files changed, 1008 insertions(+), 12 deletions(-)
>   create mode 100644 drivers/misc/timer-omap.c
>   create mode 100644 include/linux/timer-omap.h
>

[...]

> diff --git a/drivers/misc/timer-omap.c b/drivers/misc/timer-omap.c
> new file mode 100644
> index 0000000..4ee0571
> --- /dev/null
> +++ b/drivers/misc/timer-omap.c
[...]

> +
> +#if defined(CONFIG_ARCH_OMAP1)

Well this is suppose to be device driver so no place
for SOC #ifdef. You should remove this ...

> +
> +/**
> + * omap_dm_timer_modify_idlect_mask - Check if any running timers use ARMXOR
> + * @inputmask: current value of idlect mask
> + */
> +__u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask)
> +{
> +	int i = 0;
> +	struct omap_dm_timer *timer = NULL;
> +
> +	/* If ARMXOR cannot be idled this function call is unnecessary */
> +	if (!(inputmask&  (1<<  1)))
> +		return inputmask;
> +

[...]

> + * omap_dm_timer_probe - probe function called for every registered device
> + * @pdev:	pointer to current timer platform device
> + *
> + * Called by driver framework at the end of device registration for all
> + * timer devices.
> + */
> +static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
> +{
> +	int ret;
> +	struct omap_dm_timer *timer;
> +	struct resource *mem, *irq, *ioarea;
> +	struct dmtimer_platform_data *pdata = pdev->dev.platform_data;
> +
> +	if (!pdata) {
> +		dev_err(&pdev->dev, "%s: no platform data.\n", __func__);
> +		return -ENODEV;
> +	}
> +
> +	irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> +	if (unlikely(!irq)) {
> +		dev_err(&pdev->dev, "%s: no IRQ resource.\n", __func__);
> +		ret = -ENODEV;
> +		goto err_free_pdev;
> +	}
> +
> +	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	if (unlikely(!mem)) {
> +		dev_err(&pdev->dev, "%s: no memory resource.\n", __func__);
> +		ret = -ENODEV;
> +		goto err_free_pdev;
> +	}
> +
> +	ioarea = request_mem_region(mem->start, resource_size(mem),
> +			pdev->name);
> +	if (!ioarea) {
> +		dev_err(&pdev->dev, "%s: region already claimed.\n", __func__);
> +		ret = -EBUSY;
> +		goto err_free_pdev;
> +	}
> +
> +	timer = kzalloc(sizeof(struct omap_dm_timer), GFP_KERNEL);
> +	if (!timer) {
> +		dev_err(&pdev->dev, "%s: no memory for omap_dm_timer.\n",
> +			__func__);
> +		ret = -ENOMEM;
> +		goto err_release_ioregion;
> +	}
> +
> +	timer->io_base = ioremap(mem->start, resource_size(mem));
> +	if (!timer->io_base) {
> +		dev_err(&pdev->dev, "%s: ioremap failed.\n", __func__);
> +		ret = -ENOMEM;
> +		goto err_free_mem;
> +	}
> +
> +	if (pdata->timer_ip_type == OMAP_TIMER_IP_VERSION_2) {
> +		timer->func_offset = VERSION2_TIMER_WAKEUP_EN_REG_OFFSET;
> +		timer->intr_offset = VERSION2_TIMER_STAT_REG_OFFSET;
> +	} else {
> +		timer->func_offset = 0;
> +		timer->intr_offset = 0;
> +	}
> +
> +	timer->id = pdev->id;
> +	timer->irq = irq->start;
> +	timer->pdev = pdev;
> +#if defined(CONFIG_ARCH_OMAP2)

This one too ..

[...]

> diff --git a/include/linux/timer-omap.h b/include/linux/timer-omap.h
> new file mode 100644
> index 0000000..a6b4cac
> --- /dev/null
> +++ b/include/linux/timer-omap.h
> @@ -0,0 +1,351 @@
> +/*
> + * include/linux/timer-omap.h
> + *
> + * OMAP Dual-Mode Timers
> + *

[...]

> +/* register offsets */
> +#define _OMAP_TIMER_ID_OFFSET		0x00
> +#define _OMAP_TIMER_OCP_CFG_OFFSET	0x10
> +#define _OMAP_TIMER_SYS_STAT_OFFSET	0x14
> +#define _OMAP_TIMER_STAT_OFFSET		0x18
> +#define _OMAP_TIMER_INT_EN_OFFSET	0x1c
> +#define _OMAP_TIMER_WAKEUP_EN_OFFSET	0x20
> +#define _OMAP_TIMER_CTRL_OFFSET		0x24
> +#define		OMAP_TIMER_CTRL_GPOCFG		(1<<  14)
> +#define		OMAP_TIMER_CTRL_CAPTMODE	(1<<  13)
> +#define		OMAP_TIMER_CTRL_PT		(1<<  12)
> +#define		OMAP_TIMER_CTRL_TCM_LOWTOHIGH	(0x1<<  8)
> +#define		OMAP_TIMER_CTRL_TCM_HIGHTOLOW	(0x2<<  8)
> +#define		OMAP_TIMER_CTRL_TCM_BOTHEDGES	(0x3<<  8)
> +#define		OMAP_TIMER_CTRL_SCPWM		(1<<  7)
> +#define		OMAP_TIMER_CTRL_CE		(1<<  6) /* compare enable */
> +#define		OMAP_TIMER_CTRL_PRE		(1<<  5) /* prescaler enable */
> +#define		OMAP_TIMER_CTRL_PTV_SHIFT	2 /* prescaler value shift */
> +#define		OMAP_TIMER_CTRL_POSTED		(1<<  2)
> +#define		OMAP_TIMER_CTRL_AR		(1<<  1) /* auto-reload enable */
> +#define		OMAP_TIMER_CTRL_ST		(1<<  0) /* start timer */
Fix the indentation above and in rest of the file.

Regards
Santosh

  reply	other threads:[~2011-04-29 10:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-16 15:50 [PATCH v13 00/11] dmtimer adaptation to platform_driver Tarun Kanti DebBarma
2011-04-16 15:50 ` [PATCH v13 01/11] OMAP2+: dmtimer: add device names to flck nodes Tarun Kanti DebBarma
2011-04-16 15:50 ` [PATCH v13 02/11] OMAP4: hwmod data: add dmtimer version information Tarun Kanti DebBarma
2011-04-16 15:50 ` [PATCH v13 03/11] OMAP1: dmtimer: conversion to platform devices Tarun Kanti DebBarma
2011-04-16 15:50 ` [PATCH v13 04/11] OMAP2+: dmtimer: convert " Tarun Kanti DebBarma
2011-04-25  9:38   ` DebBarma, Tarun Kanti
2011-04-29 10:45   ` Santosh Shilimkar
2011-04-16 15:50 ` [PATCH v13 05/11] OMAP: dmtimer: platform driver Tarun Kanti DebBarma
2011-04-16 15:50 ` [PATCH v13 06/11] dmtimer: switch-over to platform device driver Tarun Kanti DebBarma
2011-04-16 15:50 ` [PATCH v13 07/11] OMAP: dmtimer: pm_runtime support Tarun Kanti DebBarma
2011-04-16 15:51 ` [PATCH v13 08/11] OMAP: dmtimer: add timeout to low-level routines Tarun Kanti DebBarma
2011-04-16 15:51 ` [PATCH v13 09/11] OMAP: dmtimer: use mutex instead of spinlock Tarun Kanti DebBarma
2011-04-16 15:51 ` [PATCH v13 10/11] OMAP: dmtimer: mark clocksource and clockevent timers reserved Tarun Kanti DebBarma
2011-04-17  6:12   ` Santosh Shilimkar
2011-04-18  5:50     ` DebBarma, Tarun Kanti
2011-04-25  9:41   ` DebBarma, Tarun Kanti
2011-04-29 10:40     ` Santosh Shilimkar
2011-04-16 15:51 ` [PATCH v13 11/11] OMAP: dmtimer: convert to a driver Tarun Kanti DebBarma
2011-04-29 10:51   ` Santosh Shilimkar [this message]
2011-04-29 11:05 ` [PATCH v13 00/11] dmtimer adaptation to platform_driver Santosh Shilimkar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DBA9841.1080508@ti.com \
    --to=santosh.shilimkar@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=tarun.kanti@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox