hwclock: add --param-get option
Implement the RTC_PARAM_GET RTC ioctl in hwclock. The ioctl interface was
introduced with [1], which went mainline in Kernel v5.16. The parameters
are independent of hardware/driver. This means we can read and set
parameters in a generic way.
The new --param-get hwclock function accepts aliases for parameters
currently existent (Kernel v5.16). They can be extended later on. As
fallback, hexadecimal (if prefixed with 0x) and decimal values, as
defined in [2], are accepted.
Example:
$ hwclock --param-get features
[1] https://lore.kernel.org/all/
20211018151933.76865-1-alexandre.belloni@bootlin.com/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/rtc.h
Signed-off-by: Bastian Krause <bst@pengutronix.de>