Messages in this thread | | | Date | Thu, 23 Oct 2014 15:47:06 +0200 | From | Andrew Lunn <> | Subject | Re: [PATCH 06/14] net: dsa: Add support for hardware monitoring |
| |
> >>+static DEVICE_ATTR_RO(temp1_input); > > > >You probably want the number of temperature sensors to come from the > >switch driver, and support arbitrary number of temperature sensors? > > In that case we would need the number of sensors, pass a sensor index, > and create a dynamic number of attributes. The code would get much more > complex without real benefit unless there is such a chip
We are two different use cases here:
One switch chip with multiple temperature sensors Multiple switch chips, each with its own temperature sensor.
I don't know of any hardware using either of these uses cases, but they could appear in the future.
If we are not doing the generic implementation now, how about avoiding an ABI break in the future, by hard coding the sensors with .0.0 on the end?
Andrew
| |