Enable the processing of HID input records before the RTC will be
registered, in order to allow the RTC register function to read clock.
Without doing that the clock can only be read after the probe function
has finished.
Signed-off-by: Alexander Holler <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change to
make the code simpler and enhance the readability.
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Open sensor hub when module is loaded and close when module is removed.
This helps saving power by opening HID transport only when there is an
user.
Signed-off-by: Srinivas Pandruvada <[email protected]>
Acked-by: Alessandro Zummo <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
Stop processing hid input when registering the RTC fails and handle a NULL
returned from devm_rtc_device_register() as a failure too.
Signed-off-by: Alexander Holler <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
In order to get the module automatically loaded by hotplug mechanisms a
MODULE_DEVICE_TABLE is needed.
Therefore add one.
This makes it also possible to use a module name other than
HID-SENSOR-2000a0 which isn't very descriptive in kernel messages.
Signed-off-by: Alexander Holler <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
The draft for HID-sensors (HUTRR39) currently doesn't define the range
for the attribute year. Asking one of the authors revealed that full
years (e.g. 2013 instead of just 13) were meant.
So we now allow both, 8 bit and 16 bit values for the attribute year and
assuming full years when the value is 16 bits wide.
We will still support 8 bit values until the specification gets final
(and maybe defines a way to set the time too).
Signed-off-by: Alexander Holler <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: Lars-Peter Clausen <[email protected]>
Cc: Jonathan Cameron <[email protected]>
Cc: Jiri Kosina <[email protected]>
Cc: John Stultz <[email protected]>
Cc: Jingoo Han <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
devm_rtc_device_register() is device managed and makes cleanup paths
simpler.
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
The structure with common attributes for hid-sensors isn't specific
to the iio-subsystem, so rename it to hid_sensor_common.
Signed-off-by: Alexander Holler <[email protected]>
Acked-by: Jiri Kosina <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
This driver makes the time from HID sensors (hubs) which are offering
such available like any other RTC does.
It is necessary that all values like year, month etc, are send as
8bit values (1 byte each) and all of them in 1 report. Also the
spec HUTRR39b doesn't define the range of the year field, we
tread it as 0 - 99 because that's what most RTCs I know about are
offering.
Currently the time can only be read. Setting the time must be done
through sending a report (or a feature). The spec currently doesn't
define how and I'm not sure if I just should define something by myself.
Signed-off-by: Alexander Holler <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>