public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthias Kaehlcke <matthias.list@kaehlcke.net>
To: Venu Byravarasu <vbyravarasu@nvidia.com>
Cc: "a.zummo@towertech.it" <a.zummo@towertech.it>,
	"sameo@linux.intel.com" <sameo@linux.intel.com>,
	"broonie@opensource.wolfsonmicro.com" 
	<broonie@opensource.wolfsonmicro.com>,
	Laxman Dewangan <ldewangan@nvidia.com>,
	"kyle.manna@fuel7.com" <kyle.manna@fuel7.com>,
	"sboyd@codeaurora.org" <sboyd@codeaurora.org>,
	"rtc-linux@googlegroups.com" <rtc-linux@googlegroups.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] rtc: tps65910: Add RTC driver for TPS65910 PMIC RTC
Date: Thu, 2 Aug 2012 22:00:48 +0200	[thread overview]
Message-ID: <20120802200048.GL4701@darwin> (raw)
In-Reply-To: <D958900912E20642BCBC71664EFECE3E6DDCAC4704@BGMAIL02.nvidia.com>

Hi Venu,

thanks for you reply

El Thu, Aug 02, 2012 at 10:28:47AM +0530 Venu Byravarasu ha dit:

> > -----Original Message-----
> > From: Matthias Kaehlcke [mailto:matthias.list@kaehlcke.net]
> > Sent: Thursday, August 02, 2012 1:48 AM
> > To: Venu Byravarasu
> > Cc: a.zummo@towertech.it; sameo@linux.intel.com;
> > broonie@opensource.wolfsonmicro.com; Laxman Dewangan;
> > kyle.manna@fuel7.com; sboyd@codeaurora.org; rtc-
> > linux@googlegroups.com; linux-kernel@vger.kernel.org
> > Subject: Re: [PATCH v2] rtc: tps65910: Add RTC driver for TPS65910 PMIC RTC
> > 
> > hi,
> > 
> > El Wed, Aug 01, 2012 at 11:52:37AM +0530 Venu Byravarasu ha dit:
> > 
> > > TPS65910 PMIC is a MFD with RTC as one of the device.
> > > Adding RTC driver for supporting RTC device present
> > > inside TPS65910 PMIC.
> > >
> > > Only support for RTC alarm is implemented as part of this patch.
> > >
> > > Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
> > > ---
> > 
> > ...
> > 
> > > +static irqreturn_t tps65910_rtc_interrupt(int irq, void *rtc)
> > > +{
> > > +	struct device *dev = rtc;
> > > +	unsigned long events = 0;
> > > +	struct tps65910 *tps = dev_get_drvdata(dev->parent);
> > > +	struct tps65910_rtc *tps_rtc = dev_get_drvdata(dev);
> > >
> > > ...
> > >
> > > +static int __devinit tps65910_rtc_probe(struct platform_device *pdev)
> > > +{
> > >
> > > ...
> > >
> > > +	ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
> > > +		tps65910_rtc_interrupt, IRQF_TRIGGER_LOW,
> > > +		"rtc-tps65910", &pdev->dev);
> > > +	if (ret < 0) {
> > > +		dev_err(&pdev->dev, "IRQ is not free.\n");
> > > +		return ret;
> > > +	}
> > > +	device_init_wakeup(&pdev->dev, 1);
> > > +
> > > +	tps_rtc->rtc = rtc_device_register(pdev->name, &pdev->dev,
> > > +		&tps65910_rtc_ops, THIS_MODULE);
> > > +	if (IS_ERR(tps_rtc->rtc)) {
> > > +		ret = PTR_ERR(tps_rtc->rtc);
> > > +		dev_err(&pdev->dev, "RTC device register: err %d\n", ret);
> > > +		return ret;
> > > +	}
> > > +
> > > +	platform_set_drvdata(pdev, tps_rtc);
> > 
> > the interrupt should be requested after this call. otherwise
> > tps65910_rtc_interrupt() could be executed before the RTC device is
> > registered and the driver data set. normally this shouldn't happen as
> > the RTC interrupts are disabled after reset, but the interrupts could
> > have been enabled for example by the bootloader
> 
> Hi Matthias,
> 
> Thanks for your comments.
> All pending RTC interrupts are being cleared in probe, before enabling RTC itself.
> Hence chances of stray interrupts from boot loader cannot cause any trouble here.
> 
> The only possible way of getting interrupt by kernel driver is by enabling 
> tps65910_rtc_alarm_irq_enable() && setting alarm time using tps65910_rtc_set_alarm.
> However before probe gets completed as these two APIs will not get 
> called together by the client, I do not see any false interrupt getting generated.

i was thinking in the periodic interrupts, but now noticed that the
driver only registers to the alarm interrupts, so this is not a
problem

kind regards

-- 
Matthias Kaehlcke
Embedded Linux Developer
Amsterdam

    El optimista tiene siempre un proyecto; el pesimista, una excusa
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

      reply	other threads:[~2012-08-02 20:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-01  6:22 [PATCH v2] rtc: tps65910: Add RTC driver for TPS65910 PMIC RTC Venu Byravarasu
2012-08-01 20:18 ` Matthias Kaehlcke
2012-08-02  4:58   ` Venu Byravarasu
2012-08-02 20:00     ` Matthias Kaehlcke [this message]

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=20120802200048.GL4701@darwin \
    --to=matthias.list@kaehlcke.net \
    --cc=a.zummo@towertech.it \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=kyle.manna@fuel7.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    --cc=sameo@linux.intel.com \
    --cc=sboyd@codeaurora.org \
    --cc=vbyravarasu@nvidia.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