This Embedded Controller has an internal RTC that is exposed as a standard RTC class driver with read/write functionality. The driver is added to the drivers/rtc/ so that the maintainer of that directory will be able to comment on this change, as that maintainer is the expert on this system. In addition, the driver code is called indirectly after a corresponding device is registered from core.c, as opposed to core.c registering the driver callbacks directly. To test: > hwclock --show --rtc /dev/rtc1 2007-12-31 16:01:20.460959-08:00 > hwclock --systohc --rtc /dev/rtc1 > hwclock --show --rtc /dev/rtc1 2018-11-29 17:08:00.780793-08:00 > hwclock --show --rtc /dev/rtc1 2007-12-31 16:01:20.460959-08:00 > hwclock --systohc --rtc /dev/rtc1 > hwclock --show --rtc /dev/rtc1 2018-11-29 17:08:00.780793-08:00
Showing the changes to include/linux (1 of 5 files). Show all
Unified · Split
| @@ -35,6 +35,7 @@ · 34 unmodified lines | ||
| 35 | 35 | * is used to hold the request and the response. |
| 36 | 36 | * @data_size: Size of the data buffer used for EC communication. |
| 37 | 37 | * @debugfs_pdev: The child platform_device used by the debugfs sub-driver. |
| 38 | + * @rtc_pdev: The child platform_device used by the RTC sub-driver. | |
| 38 | 39 | */ |
| 39 | 40 | struct wilco_ec_device { |
| 40 | 41 | struct device *dev; |
| @@ -45,6 +46,7 @@ struct wilco_ec_device { · 4 unmodified lines | ||
| 45 | 46 | void *data_buffer; |
| 46 | 47 | size_t data_size; |
| 47 | 48 | struct platform_device *debugfs_pdev; |
| 49 | + struct platform_device *rtc_pdev; | |
| 48 | 50 | }; |
| 49 | 51 | |
| 50 | 52 | /** |