Re: [PATCH] drivers: rtc: Add driver for SD2405AL.

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

 



Dear Bence,

thank you for your review!

> Is there a reason why this can't be a ds1307 variant? 

I think it is different enough to get its own driver.

> If you really need the separate driver, then you can take a feather out of
> rtc-ds1307's hat and use `dev_set_drvdata()` instead of
> `i2c_set_clientdata()`, `dev_err()` instead of `printk()`, use the `BIT()`
> macro etc.

Okay, I'll refactor the driver to use those.

> * Even though you defined alarm registers, you're not implementing alarm
> capabilities. This should not be hard, given the datasheet and the drivers
> of similar RTCs.

I'll try to add this feature.

> no need to #define all alarm
> registers, the alarm base+offset should suffice.

I like to copy the datasheet as is.

> * Also, you're not doing anything with the control & status registers. At
> the least, in `read_time()` you should check that the RTC is running by
> checking CTR1.RTCF, and if it's 0, return -EINVAL. Similarly, in
> `set_time()` you're not checking if the RTC is writable.

You are absoultelly right, I've missed those registers.

János




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

  Powered by Linux