Skip to contentSkip to conversation

acpi-als taking over from hwmon for light sensor support?

DISCUSSION Bastien Nocera 3 participants 5 messages Nov 23, 2016 – Nov 24, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hey,

I did some work on iio-sensor-proxy[1] those past couple of days, and tested it on a MacBook Pro.

Before that, I had written a (user-space) driver to access the hwmon driver's "light" value, so I was a bit surprised when I saw that iio- sensor-proxy was accessing the light sensor through acpi-als's IIO driver instead of through the hwmon driver.

I looked through the hwmon, iio and applesmc.c logs, and couldn't find any information about how the move from one to the other. Does anyone know?

I'm asking because the applesmc.c hwmon driver is the only one with support for the "light" property, and if that's not used anymore, I might as well remove that code now (or schedule to remove it).

Cheers

#1 lore raw
Quoted 10 lines · Bastien Nocera

Hey,

I did some work on iio-sensor-proxy[1] those past couple of days, and tested it on a MacBook Pro.

Before that, I had written a (user-space) driver to access the hwmon driver's "light" value, so I was a bit surprised when I saw that iio- sensor-proxy was accessing the light sensor through acpi-als's IIO driver instead of through the hwmon driver.

Quoted 7 lines

I looked through the hwmon, iio and applesmc.c logs, and couldn't find any information about how the move from one to the other. Does anyone know?

I'm asking because the applesmc.c hwmon driver is the only one with support for the "light" property, and if that's not used anymore, I might as well remove that code now (or schedule to remove it).

Light sensors are out of scope of hwmon, they have nothing to do with hardware monitoring.

Signature · 2 lines
Jean Delvare
SUSE L3 Support
#2 lore raw
Quoted 20 lines · Jean Delvare
Quoted 19 lines · Bastien Nocera

Hey,

I did some work on iio-sensor-proxy[1] those past couple of days, and
tested it on a MacBook Pro.

Before that, I had written a (user-space) driver to access the hwmon
driver's "light" value, so I was a bit surprised when I saw that iio-
sensor-proxy was accessing the light sensor through acpi-als's IIO driver instead of through the hwmon driver.

I looked through the hwmon, iio and applesmc.c logs, and couldn't find
any information about how the move from one to the other. Does anyone
know?

Quoted 6 lines
Quoted 3 lines

I'm asking because the applesmc.c hwmon driver is the only one with support for the "light" property, and if that's not used anymore, I might as well remove that code now (or schedule to remove it).

Light sensors are out of scope of hwmon, they have nothing to do with hardware monitoring.

Why is there still code in applesmc.c to handle the "light" sysfs property then?

Also, this doesn't answer my question as to when this switch happened. I don't care one way or the other, but knowing when the switch was made can allow me to prepare the hwmon driver in iio-sensor-proxy for removal.

Cheers

maintainer
#3 lore raw
Quoted 19 lines · Bastien Nocera
Quoted 18 lines · Jean Delvare
Quoted 16 lines · Bastien Nocera

Hey,

I did some work on iio-sensor-proxy[1] those past couple of days, and tested it on a MacBook Pro.

Before that, I had written a (user-space) driver to access the hwmon driver's "light" value, so I was a bit surprised when I saw that iio- sensor-proxy was accessing the light sensor through acpi-als's IIO driver instead of through the hwmon driver.

I looked through the hwmon, iio and applesmc.c logs, and couldn't find any information about how the move from one to the other. Does anyone know?

I'm asking because the applesmc.c hwmon driver is the only one with support for the "light" property, and if that's not used anymore, I might as well remove that code now (or schedule to remove it).

Quoted 6 lines
Quoted 2 lines

Light sensors are out of scope of hwmon, they have nothing to do with hardware monitoring.

Why is there still code in applesmc.c to handle the "light" sysfs property then?

Interesting question. Because no one bothered enough to remove it ? Because other applications may still use it ? Because old apple hardware may not support ACPI0008 ? There can be many reasons.

If the question is why it is there in the first place, please keep in mind that the driver is quite old. "For historic reasons" may be the best answer to that question.

Quoted 5 lines

Also, this doesn't answer my question as to when this switch happened. I don't care one way or the other, but knowing when the switch was made can allow me to prepare the hwmon driver in iio-sensor-proxy for removal.

From kernel perspective, it may have been more or less automatic with

the addition of acpi-als support to iio. Either case, isn't it up to iio-sensor-proxy to decide which kernel ABI it wants to use ?

Guenter

#4 lore raw
Quoted 37 lines · Guenter Roeck
Quoted 27 lines · Bastien Nocera
Quoted 26 lines · Jean Delvare
Quoted 24 lines · Bastien Nocera

Hey,

I did some work on iio-sensor-proxy[1] those past couple of days, and
tested it on a MacBook Pro.

Before that, I had written a (user-space) driver to access the hwmon
driver's "light" value, so I was a bit surprised when I saw that iio-
sensor-proxy was accessing the light sensor through acpi-als's IIO driver
instead of through the hwmon driver.

I looked through the hwmon, iio and applesmc.c logs, and couldn't find any
information about how the move from one to the other. Does anyone know?

I'm asking because the applesmc.c hwmon driver is the only one with
support for the "light" property, and if that's not used anymore, I might
as well remove that code now (or schedule to remove it).

Quoted 8 lines
Quoted 3 lines

Light sensors are out of scope of hwmon, they have nothing to do with
hardware monitoring.

Why is there still code in applesmc.c to handle the "light" sysfs property
then?

Quoted 5 lines

Interesting question. Because no one bothered enough to remove it ? Because
other applications may still use it ? Because old apple hardware may not
support ACPI0008 ? There can be many reasons.

All good reasons. The lack of ACPI0008 support would be the main reason for me to keep the hwmon driver support in iio-sensor-proxy.

Quoted 5 lines

If the question is why it is there in the first place, please keep in mind that
the driver is quite old. "For historic reasons" may be the best answer to that
question.

Oh, I know it's old, I've used it on 2 different Intel-based MacBook Airs ;)

Quoted 11 lines
Quoted 7 lines

Also, this doesn't answer my question as to when this switch happened.  I
don't care one way or the other, but knowing when the switch was made can
allow me to prepare the hwmon driver in iio-sensor-proxy for removal.

From kernel perspective, it may have been more or less automatic with the addition of acpi-als support to iio. Either case, isn't it up to iio-sensor-proxy to decide which kernel ABI it wants to use ?

In this case, we don't have a choice, the device is getting bound to the acpi-als driver and hwmon just doesn't have the light support. In any case, iio-sensor-proxy only binds to a single sensor of each type, so we're good here.

I'll leave the hwmon support for older Intel Macs in.

Cheers