public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: jonghwa3.lee@samsung.com
To: "devendra.aaru" <devendra.aaru@gmail.com>
Cc: linux-kernel@vger.kernel.org, a.zummo@towertech.it,
	Andrew Morton <akpm@linux-foundation.org>,
	rtc-linux@googlegroups.com
Subject: Re: [PATCH] rtc: max8997: Add driver for max8997 rtc.
Date: Thu, 07 Feb 2013 13:22:56 +0900	[thread overview]
Message-ID: <51132C20.80302@samsung.com> (raw)
In-Reply-To: <CAHdPZaOLJJYDwsaLadvCnLe=-Hr+_HpRPXHebm3jgQtPO4WASg@mail.gmail.com>

On 2013년 02월 07일 13:14, devendra.aaru wrote:
> Hello,
> 
> On Wed, Feb 6, 2013 at 4:53 PM, Jonghwa Lee <jonghwa3.lee@samsung.com> wrote:
>> This patch adds rtc driver for Maxim 8997 multifunction chip.
>> Max8997 has rtc module in it. and it can be used for timekeeping
>> clock and system alarm. It provide various operational mode those are
>> BCD/binary, 24/12hour, am/pm. Driver sets binary/24/ for default.
>> Maxim 8997 also supports SMPL(Sudden Momentary Power Loss), WTSR
>> (Watchdog Timeout and Software Reset).
>>
>> Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
>> ---
>>  drivers/rtc/Kconfig       |   30 +++
>>  drivers/rtc/Makefile      |    1 +
>>  drivers/rtc/rtc-max8997.c |  542 +++++++++++++++++++++++++++++++++++++++++++++
>>  3 files changed, 573 insertions(+)
>>  create mode 100644 drivers/rtc/rtc-max8997.c
>>
>> +
>> +static int max8997_rtc_probe(struct platform_device *pdev)
>> +{
>> +       struct max8997_dev *max8997 = dev_get_drvdata(pdev->dev.parent);
>> +       struct max8997_rtc_info *info;
>> +       int ret, virq;
>> +
>> +       info = devm_kzalloc(&pdev->dev, sizeof(struct max8997_rtc_info),
>> +                       GFP_KERNEL);
>> +       if (!info)
>> +               return -ENOMEM;
>> +
>> +       mutex_init(&info->lock);
>> +       info->dev = &pdev->dev;
>> +       info->max8997 = max8997;
>> +       info->rtc = max8997->rtc;
>> +
>> +       platform_set_drvdata(pdev, info);
>> +
>> +       ret = max8997_rtc_init_reg(info);
>> +
>> +       if (ret < 0) {
>> +               dev_err(&pdev->dev, "Failed to initialize RTC reg:%d\n", ret);
>> +               return ret;
>> +       }
>> +
>> +       max8997_rtc_enable_wtsr(info, true);
>> +       max8997_rtc_enable_smpl(info, true);
>> +
>> +       device_init_wakeup(&pdev->dev, 1);
>> +
>> +       info->rtc_dev = rtc_device_register("max8997-rtc", &pdev->dev,
>> +                       &max8997_rtc_ops, THIS_MODULE);
>> +
>> +       if (IS_ERR(info->rtc_dev)) {
>> +               ret = PTR_ERR(info->rtc_dev);
>> +               dev_err(&pdev->dev, "Failed to register RTC device: %d\n", ret);
>> +               return ret;
>> +       }
>> +
>> +       virq = irq_create_mapping(max8997->irq_domain, MAX8997_PMICIRQ_RTCA1);
>> +       if (!virq) {
>> +               dev_err(&pdev->dev, "Failed to create mapping alarm IRQ\n");
>    +               rtc_device_unregister(&pdev->dev, &max8997_rtc_ops) ?

Yes, It should be,,

>> +               return ret;
>> +       }
>> +       info->virq = virq;
>> +
>> +       ret = request_threaded_irq(virq, NULL, max8997_rtc_alarm_irq, 0,
>> +                               "rtc-alarm0", info);
>> +       if (ret < 0) {
>> +               dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n",
>> +                       info->virq, ret);
>    +               here unregistering the rtc dev too?

also

>> +               return ret;
>> +       }
>> +
>> +       return ret;
>> +}
>> +
> 

Thanks for reviewing, I'll fix it.

Thanks,
Jonghwa

> 
> Thanks,
> 

      reply	other threads:[~2013-02-07  4:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-06 11:23 [PATCH] rtc: max8997: Add driver for max8997 rtc Jonghwa Lee
2013-02-06 21:06 ` Andrew Morton
2013-02-07  1:43   ` jonghwa3.lee
2013-02-07  2:28     ` Andrew Morton
2013-02-07  3:37       ` jonghwa3.lee
2013-02-07  4:14 ` devendra.aaru
2013-02-07  4:22   ` jonghwa3.lee [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=51132C20.80302@samsung.com \
    --to=jonghwa3.lee@samsung.com \
    --cc=a.zummo@towertech.it \
    --cc=akpm@linux-foundation.org \
    --cc=devendra.aaru@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.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