Re: [PATCH 4/4] rtc: pcf2127: add watchdog feature support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 24/07/2019 09:18:05+0200, Bruno Thomsen wrote:
> Den tir. 23. jul. 2019 kl. 20.48 skrev Alexandre Belloni
> <alexandre.belloni@xxxxxxxxxxx>:
> >
> > > +config RTC_DRV_PCF2127_WDT
> > > +     bool "NXP PCF2127 watchdog timer"
> > > +     depends on RTC_DRV_PCF2127
> > > +     help
> > > +       If you say Y here you will get support for the watchdog timer
> > > +       in the NXP PCF2127 and PCF2129 real-time clock chips.
> > > +
> > > +       The watchdog is usually used together with systemd or the
> > > +       watchdog daemon. Watchdog trigger cause system reset.
> > > +
> >
> > I wouldn't add a new Kconfig entry for that. How much bigger will it be?
> 
> Delta size on rtc-pcf2127.ko is 3244 bytes when compiled for armv7a.
> 
> I only added Kconfig option to allow driver load on arm platforms where
> you need to use internal watchdog to restart board. But I will remove it
> for next version, should I extend help text on exiting Kconfig option to
> also include information about other chip features? As this is not a
> simple RTC chip.

You can extend the Kconfig help if you want.

> 
> > > +static const struct file_operations pcf2127_wdt_fops = {
> > > +     .owner = THIS_MODULE,
> > > +     .write = pcf2127_wdt_write,
> > > +     .unlocked_ioctl = pcf2127_wdt_ioctl,
> > > +};
> > > +
> > > +static struct miscdevice pcf2127_miscdev = {
> > > +     .minor = WATCHDOG_MINOR,
> > > +     .name = "watchdog",
> > > +     .fops = &pcf2127_wdt_fops,
> > > +};
> >
> > Wow, that is old school, please use the watchdog subsysteů.
> 
> Okay, I was not aware that this was an old API. So I should convert
> to struct watchdog_ops and devm_watchdog_register_device?
> 

Yes, that is what I was asking for.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux