hwmon: (max6650) Add support for gpiodef
PATCH 1/1 hwmon: (max6650) Add support for gpiodef
It is necessary for end users when they are using the gpio pins connected to the fan controller. There is a separate gpiodef register provided, but it is unused under the usual circumstances and that is probably the reason why this feature has not been added before. It is necessary for our board to function properly.
--- Documentation/hwmon/max6650 | 5 +++ drivers/hwmon/max6650.c | 107 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+)
Documentation/hwmon/max6650 +5 -0
@@ -39,6 +39,11 @@ pwm1 rw relative speed (0-255), 255=max. speed. fan1_div rw sets the speed range the inputs can handle. Legal values are 1, 2, 4, and 8. Use lower values for faster fans. +gpio0 rw sets the gpio 0 PIN. Legal values are 0, 1, 2, and 3. +gpio1 rw sets the gpio 1 PIN. Legal values are 0, 1, 2, and 3. +gpio2 rw sets the gpio 2 PIN. Legal values are 0, 1, 2, and 3. +gpio3 rw sets the gpio 3 PIN. Legal values are 0, and 1. +gpio4 rw sets the gpio 4 PIN. Legal values are 0, and 1. Usage notes -----------
drivers/hwmon/max6650.c +107 -0
149 lines not on this page · raw message
Signature · 7 lines
1.8.4.2 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerQuoted 16 lines · Laszlo Papp
It is necessary for end users when they are using the gpio pins connected to the fan controller. There is a separate gpiodef register provided, but it is unused under the usual circumstances and that is probably the reason why this feature has not been added before. It is necessary for our board to function properly.
Signed-off-by Laszlo Papp <[email protected]>--- Documentation/hwmon/max6650 | 5 +++ drivers/hwmon/max6650.c | 107 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+)Documentation/hwmon/max6650 +0
-0
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255), 255=max. speed. · line 47
Quoted 9 lines
Documentation/hwmon/max6650 +5
-0@@ -39,6 +39,11 @@ pwm1 rw relative speed (0-255), 255=max. speed. fan1_div rw sets the speed range the inputs can handle. Legal values are 1, 2, 4, and 8. Use lower values for faster fans. +gpio0 rw sets the gpio 0 PIN. Legal values are 0, 1, 2, and 3. +gpio1 rw sets the gpio 1 PIN. Legal values are 0, 1, 2, and 3. +gpio2 rw sets the gpio 2 PIN. Legal values are 0, 1, 2, and 3. +gpio3 rw sets the gpio 3 PIN. Legal values are 0, and 1. +gpio4 rw sets the gpio 4 PIN. Legal values are 0, and 1.
gpio pins should be exported through the gpio subsystem, usually with a gpio driver. In this case, it may be acceptable to have the driver register with the gpio subsystem to export the pins. Using local sysfs attributes is wrong and unacceptable.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 32 lines · Guenter Roeck
Quoted 1 line · Laszlo Papp
It is necessary for end users when they are using the gpio pins
connected to the
Quoted 1 line
fan controller. There is a separate gpiodef register provided, but it is
unused
Quoted 1 line
under the usual circumstances and that is probably the reason why this
feature
Quoted 1 line
has not been added before. It is necessary for our board to function
properly.
Quoted 5 lines
Signed-off-by Laszlo Papp <[email protected]>--- Documentation/hwmon/max6650 | 5 +++ drivers/hwmon/max6650.c | 107++++++++++++++++++++++++++++++++++++++++++++
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255),
Quoted 7 lines
2 files changed, 112 insertions(+)Documentation/hwmon/max6650 +0
-0@@ -39,6 +39,11 @@ pwm1 rw relative speed (0-255),255=max. speed.
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255), 255=max. speed.
Quoted 4 lines
Documentation/hwmon/max6650 +1
-0fan1_div rw sets the speed range the inputs can handle. Legal values are 1, 2, 4, and 8. Use lower values for faster fans. +gpio0 rw sets the gpio 0 PIN. Legal values are 0, 1, 2, and3.
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255), · line 43
Quoted 1 line
Documentation/hwmon/max6650 +1
-0+gpio1 rw sets the gpio 1 PIN. Legal values are 0, 1, 2, and3.
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255), · line 44
Quoted 1 line
Documentation/hwmon/max6650 +1
-0+gpio2 rw sets the gpio 2 PIN. Legal values are 0, 1, 2, and3.
Quoted 10 lines
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255), 255=max. speed. · line 47
Quoted 3 lines
Documentation/hwmon/max6650 +2
-0+gpio3 rw sets the gpio 3 PIN. Legal values are 0, and 1. +gpio4 rw sets the gpio 4 PIN. Legal values are 0, and 1.gpio pins should be exported through the gpio subsystem, usually with a gpio
driver. In this case, it may be acceptable to have the driver register with the gpio subsystem to export the pins. Using local sysfs attributes is wrong
and unacceptable.
In short: I am not sure.
My concern is that these are not generic gpio pins. They seem to have chip specific functionality, like alarm, full-on, and clock (internal and external). Strictly speaking, one could even mention that to expose the GPIODEF register as is without splitting it into five separate gpio pin entries. Even those five pins behave slightly differently.
I considered both, but these are the reasons why I decided to keep it chip specific rather than separately in a generic subsystem.
Cheers,
Laszlo
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerQuoted 47 lines · Laszlo Papp
Quoted 32 lines · Guenter Roeck
Quoted 1 line · Laszlo Papp
It is necessary for end users when they are using the gpio pins
connected to the
Quoted 1 line
fan controller. There is a separate gpiodef register provided, but it is
unused
Quoted 1 line
under the usual circumstances and that is probably the reason why this
feature
Quoted 1 line
has not been added before. It is necessary for our board to function
properly.
Quoted 5 lines
Signed-off-by Laszlo Papp <[email protected]>--- Documentation/hwmon/max6650 | 5 +++ drivers/hwmon/max6650.c | 107++++++++++++++++++++++++++++++++++++++++++++
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255),
Quoted 7 lines
2 files changed, 112 insertions(+)Documentation/hwmon/max6650 +0
-0@@ -39,6 +39,11 @@ pwm1 rw relative speed (0-255),255=max. speed.
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255), 255=max. speed.
Quoted 4 lines
Documentation/hwmon/max6650 +1
-0fan1_div rw sets the speed range the inputs can handle. Legal values are 1, 2, 4, and 8. Use lower values for faster fans. +gpio0 rw sets the gpio 0 PIN. Legal values are 0, 1, 2, and3.
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255), · line 43
Quoted 1 line
Documentation/hwmon/max6650 +1
-0+gpio1 rw sets the gpio 1 PIN. Legal values are 0, 1, 2, and3.
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255), · line 44
Quoted 1 line
Documentation/hwmon/max6650 +1
-0+gpio2 rw sets the gpio 2 PIN. Legal values are 0, 1, 2, and3.
Quoted 10 lines
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255), 255=max. speed. · line 47
Quoted 3 lines
Documentation/hwmon/max6650 +2
-0+gpio3 rw sets the gpio 3 PIN. Legal values are 0, and 1. +gpio4 rw sets the gpio 4 PIN. Legal values are 0, and 1.gpio pins should be exported through the gpio subsystem, usually with a gpio
driver. In this case, it may be acceptable to have the driver register with the gpio subsystem to export the pins. Using local sysfs attributes is wrong
and unacceptable.In short: I am not sure.
Quoted 9 lines
My concern is that these are not generic gpio pins. They seem to have chip specific functionality, like alarm, full-on, and clock (internal and external). Strictly speaking, one could even mention that to expose the GPIODEF register as is without splitting it into five separate gpio pin entries. Even those five pins behave slightly differently.
I considered both, but these are the reasons why I decided to keep it chip specific rather than separately in a generic subsystem.
If the registers are not really gpio pins but are needed / used for chip configuration, the other option would be to configure the values using platform data and/or devicetree data. Either case, exporting the pins to user space via sysfs attribute files in the device directory is the wrong approach.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 54 lines · Guenter Roeck
Quoted 53 lines · Laszlo Papp
Quoted 32 lines · Guenter Roeck
Quoted 1 line · Laszlo Papp
It is necessary for end users when they are using the gpio pins
connected to the
Quoted 1 line
fan controller. There is a separate gpiodef register provided, but it is
unused
Quoted 1 line
under the usual circumstances and that is probably the reason why this
feature
Quoted 1 line
has not been added before. It is necessary for our board to function
properly.
Quoted 5 lines
Signed-off-by Laszlo Papp <[email protected]>--- Documentation/hwmon/max6650 | 5 +++ drivers/hwmon/max6650.c | 107++++++++++++++++++++++++++++++++++++++++++++
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255),
Quoted 7 lines
2 files changed, 112 insertions(+)Documentation/hwmon/max6650 +0
-0@@ -39,6 +39,11 @@ pwm1 rw relative speed (0-255),255=max. speed.
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255), 255=max. speed.
Quoted 4 lines
Documentation/hwmon/max6650 +1
-0fan1_div rw sets the speed range the inputs can handle. Legal values are 1, 2, 4, and 8. Use lower values for faster fans. +gpio0 rw sets the gpio 0 PIN. Legal values are 0, 1, 2, and3.
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255), · line 43
Quoted 1 line
Documentation/hwmon/max6650 +1
-0+gpio1 rw sets the gpio 1 PIN. Legal values are 0, 1, 2, and3.
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255), · line 44
Quoted 1 line
Documentation/hwmon/max6650 +1
-0+gpio2 rw sets the gpio 2 PIN. Legal values are 0, 1, 2, and3.
Quoted 10 lines
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255), 255=max. speed. · line 47
Quoted 3 lines
Documentation/hwmon/max6650 +2
-0+gpio3 rw sets the gpio 3 PIN. Legal values are 0, and 1. +gpio4 rw sets the gpio 4 PIN. Legal values are 0, and 1.gpio pins should be exported through the gpio subsystem, usually with a gpio
driver. In this case, it may be acceptable to have the driver register with the gpio subsystem to export the pins. Using local sysfs attributes is wrong
and unacceptable.In short: I am not sure.
My concern is that these are not generic gpio pins. They seem to have chip specific functionality, like alarm, full-on, and clock (internal and external). Strictly speaking, one could even mention that to expose the GPIODEF register as is without splitting it into five separate gpio pin entries. Even those five pins behave slightly differently.
Quoted 7 lines
Quoted 3 lines
I considered both, but these are the reasons why I decided to keep it chip specific rather than separately in a generic subsystem.
If the registers are not really gpio pins but are needed / used for chip configuration, the other option would be to configure the values using platform data and/or devicetree data. Either case, exporting the pins to user space via sysfs attribute files in the device directory is the wrong approach.
Hmm, that would not allow dynamic settings on its own - if I am not mistaken - which we are in need of. I might be mistaken tough, so please forgive my shortcomings.
I was also thinking of module parameters before, as well. Perhaps that is a better approach. I am not sure. What do you think about it?
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerQuoted 63 lines · Laszlo Papp
Quoted 54 lines · Guenter Roeck
Quoted 53 lines · Laszlo Papp
Quoted 32 lines · Guenter Roeck
Quoted 1 line · Laszlo Papp
It is necessary for end users when they are using the gpio pins
connected to the
Quoted 1 line
fan controller. There is a separate gpiodef register provided, but it is
unused
Quoted 1 line
under the usual circumstances and that is probably the reason why this
feature
Quoted 1 line
has not been added before. It is necessary for our board to function
properly.
Quoted 5 lines
Signed-off-by Laszlo Papp <[email protected]>--- Documentation/hwmon/max6650 | 5 +++ drivers/hwmon/max6650.c | 107++++++++++++++++++++++++++++++++++++++++++++
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255),
Quoted 7 lines
2 files changed, 112 insertions(+)Documentation/hwmon/max6650 +0
-0@@ -39,6 +39,11 @@ pwm1 rw relative speed (0-255),255=max. speed.
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255), 255=max. speed.
Quoted 4 lines
Documentation/hwmon/max6650 +1
-0fan1_div rw sets the speed range the inputs can handle. Legal values are 1, 2, 4, and 8. Use lower values for faster fans. +gpio0 rw sets the gpio 0 PIN. Legal values are 0, 1, 2, and3.
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255), · line 43
Quoted 1 line
Documentation/hwmon/max6650 +1
-0+gpio1 rw sets the gpio 1 PIN. Legal values are 0, 1, 2, and3.
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255), · line 44
Quoted 1 line
Documentation/hwmon/max6650 +1
-0+gpio2 rw sets the gpio 2 PIN. Legal values are 0, 1, 2, and3.
Quoted 10 lines
Documentation/hwmon/max6650 pwm1 rw relative speed (0-255), 255=max. speed. · line 47
Quoted 3 lines
Documentation/hwmon/max6650 +2
-0+gpio3 rw sets the gpio 3 PIN. Legal values are 0, and 1. +gpio4 rw sets the gpio 4 PIN. Legal values are 0, and 1.gpio pins should be exported through the gpio subsystem, usually with a gpio
driver. In this case, it may be acceptable to have the driver register with the gpio subsystem to export the pins. Using local sysfs attributes is wrong
and unacceptable.In short: I am not sure.
My concern is that these are not generic gpio pins. They seem to have chip specific functionality, like alarm, full-on, and clock (internal and external). Strictly speaking, one could even mention that to expose the GPIODEF register as is without splitting it into five separate gpio pin entries. Even those five pins behave slightly differently.
Quoted 7 lines
Quoted 3 lines
I considered both, but these are the reasons why I decided to keep it chip specific rather than separately in a generic subsystem.
If the registers are not really gpio pins but are needed / used for chip configuration, the other option would be to configure the values using platform data and/or devicetree data. Either case, exporting the pins to user space via sysfs attribute files in the device directory is the wrong approach.
Quoted 7 lines
Hmm, that would not allow dynamic settings on its own - if I am not mistaken - which we are in need of. I might be mistaken tough, so please forgive my shortcomings.
I was also thinking of module parameters before, as well. Perhaps that is a better approach. I am not sure. What do you think about it?
Problem with that is that it applies to all MAX6650's.
What are those pins used for ?
If they need to be set at runtime, gpio may be a choice after all. I think I may need to get a better understanding of your use case.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 1 line · Guenter Roeck
What are those pins used for ?
I would like to drive them dynamically like the rest of the features exposed to the sysfs in a similar way.
For instance, one may need to output a logic-low level on the pin 0 to get an operation working. One use case could be (and is) enabling or disabling the fans dynamically based on the temperature, etc condition. Imagine that if you have a 12 V fan with 5 V board power supply, and such a pin would be useful to establish the bridge between them with diodes.
This is just one use case of those, you could also use it for non-generic gpio functionality, like alarm, "full-on", internal clock, external clock, etc. I believe it is always a bit tricky with MFD. I personally prefer to put it into the chip driver because this is not clearly a generic gpio interface here, and I need to drive it dynamically.
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
drivers/hwmon/max6650.c static ssize_t get_alarm(struct device *dev, struct device_attribute *devattr, · line 528
Quoted 3 lines · Laszlo Papp
drivers/hwmon/max6650.c +3
-0+case 1 : + data->gpiodef &= ~MAX6650_GPIO_DEF_GPIO1_LOW ; + data->gpiodef &= (gpio <<2 );
Yikes, that should have been "|=" of course. I will fix it if needed once the right approach is found and agreed upon...
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 6 lines
This is just one use case of those, you could also use it for non-generic gpio functionality, like alarm, "full-on", internal clock, external clock, etc. I believe it is always a bit tricky with MFD. I personally prefer to put it into the chip driver because this is not clearly a generic gpio interface here, and I need to drive it dynamically.
I agree.
I think the solution with expose the "GPIOs" in sysfs is the right way to go.
The chip-function is of a dynamic nature and should therefor not be set in platform data / devicetree.
As mentioned before, GPIOs should use the gpio subsystem whenever possible, but the the gpio-functionality is just a subset of
functions these pins may be set to.
Also, the I think the *real* reason why the entries is called "gpio" is that it is so the registers are are mentioned in the datasheet. Everyone that is working with the device will know what it is all about. I see it more as an register expose than a gpio interface...
I agree that the entries does not really fit here. But they does not fit better elsewhere either.
And I don't think they fit worse than the alarm-entries that is already in mainline.
Anyway, I think the documentation file should mention what function each valid value represent.
Cheers
Marcus Folkesson
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 24 lines · Marcus Folkesson
Quoted 7 lines
This is just one use case of those, you could also use it for non-generic gpio functionality, like alarm, "full-on", internal clock, external clock, etc. I believe it is always a bit tricky with MFD. I personally prefer to put it into the chip driver because this is not clearly a generic gpio interface here, and I need to drive it dynamically.
I agree.
I think the solution with expose the "GPIOs" in sysfs is the right way to go.
The chip-function is of a dynamic nature and should therefor not be set in platform data / devicetree.As mentioned before, GPIOs should use the gpio subsystem whenever possible, but the the gpio-functionality is just a subset of
functions these pins may be set to.Also, the I think the *real* reason why the entries is called "gpio" is that it is so the registers are are mentioned in the datasheet. Everyone that is working with the device will know what it is all about. I see it more as an register expose than a gpio interface...
Quoted 7 lines
I agree that the entries does not really fit here. But they does not fit better elsewhere either.
And I don't think they fit worse than the alarm-entries that is already in mainline.Anyway, I think the documentation file should mention what function each valid value represent.
Yes, makes sense to make the documentation more comprehensive. Thanks.
Any other issues from anyone before submitting a polished version?
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerQuoted 31 lines · Laszlo Papp
Quoted 29 lines · Marcus Folkesson
Quoted 7 lines
This is just one use case of those, you could also use it for non-generic gpio functionality, like alarm, "full-on", internal clock, external clock, etc. I believe it is always a bit tricky with MFD. I personally prefer to put it into the chip driver because this is not clearly a generic gpio interface here, and I need to drive it dynamically.
I agree.
I think the solution with expose the "GPIOs" in sysfs is the right way to go.
The chip-function is of a dynamic nature and should therefor not be set in platform data / devicetree.As mentioned before, GPIOs should use the gpio subsystem whenever possible, but the the gpio-functionality is just a subset of
functions these pins may be set to.Also, the I think the *real* reason why the entries is called "gpio" is that it is so the registers are are mentioned in the datasheet. Everyone that is working with the device will know what it is all about. I see it more as an register expose than a gpio interface...
I agree that the entries does not really fit here. But they does not fit better elsewhere either.
And I don't think they fit worse than the alarm-entries that is already in mainline.
Quoted 7 lines
Quoted 2 lines
Anyway, I think the documentation file should mention what function each valid value represent.
Yes, makes sense to make the documentation more comprehensive. Thanks.
Any other issues from anyone before submitting a polished version?
You'll have to get feedback from Jean. I won't accept the patch.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerQuoted 32 lines · Guenter Roeck
Quoted 31 lines · Laszlo Papp
Quoted 29 lines · Marcus Folkesson
Quoted 7 lines
This is just one use case of those, you could also use it for non-generic gpio functionality, like alarm, "full-on", internal clock, external clock, etc. I believe it is always a bit tricky with MFD. I personally prefer to put it into the chip driver because this is not clearly a generic gpio interface here, and I need to drive it dynamically.
I agree.
I think the solution with expose the "GPIOs" in sysfs is the right way to go.
The chip-function is of a dynamic nature and should therefor not be set in platform data / devicetree.As mentioned before, GPIOs should use the gpio subsystem whenever possible, but the the gpio-functionality is just a subset of
functions these pins may be set to.Also, the I think the *real* reason why the entries is called "gpio" is that it is so the registers are are mentioned in the datasheet. Everyone that is working with the device will know what it is all about. I see it more as an register expose than a gpio interface...
I agree that the entries does not really fit here. But they does not fit better elsewhere either.
And I don't think they fit worse than the alarm-entries that is already in mainline.
Quoted 9 lines
Quoted 7 lines
Quoted 2 lines
Anyway, I think the documentation file should mention what function each valid value represent.
Yes, makes sense to make the documentation more comprehensive. Thanks.
Any other issues from anyone before submitting a polished version?
You'll have to get feedback from Jean. I won't accept the patch.
To add to this: The datasheet clearly states that the pins are GPIO pins, three of which can be configured as ALERT output, ALL_ON input, or clock input/output. GPIO pins should be made available to the kernel through the GPIO subsystem; any clock configuration should be configured through the clock subsystem if needed. The pin configuration as ALERT output/ALL_ON input/clock is clearly board specific and should thus be provided as platform data and/or devicetree data if needed.
The existing GPIO alarm attributes should be removed. The pin values should be reported as GPIO pin values instead.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 38 lines · Guenter Roeck
Quoted 37 lines · Guenter Roeck
Quoted 36 lines · Laszlo Papp
Quoted 24 lines · Marcus Folkesson
Quoted 7 lines
This is just one use case of those, you could also use it for non-generic gpio functionality, like alarm, "full-on", internal clock, external clock, etc. I believe it is always a bit tricky with MFD. I personally prefer to put it into the chip driver because this is not clearly a generic gpio interface here, and I need to drive it dynamically.
I agree.
I think the solution with expose the "GPIOs" in sysfs is the right way to go.
The chip-function is of a dynamic nature and should therefor not be set in platform data / devicetree.As mentioned before, GPIOs should use the gpio subsystem whenever possible, but the the gpio-functionality is just a subset of
functions these pins may be set to.Also, the I think the *real* reason why the entries is called "gpio" is that it is so the registers are are mentioned in the datasheet. Everyone that is working with the device will know what it is all about. I see it more as an register expose than a gpio interface...
Quoted 7 lines
I agree that the entries does not really fit here. But they does not fit better elsewhere either.
And I don't think they fit worse than the alarm-entries that is already in mainline.Anyway, I think the documentation file should mention what function each valid value represent.
Yes, makes sense to make the documentation more comprehensive. Thanks.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Any other issues from anyone before submitting a polished version?
You'll have to get feedback from Jean. I won't accept the patch.
To add to this: The datasheet clearly states that the pins are GPIO pins, three of which can be configured as ALERT output,
ALL_ONinput, or clock input/output.
Which is inline with what we wrote before. Although, you probably meant FULL_ON rather than ALL_ON. There is no "ALL_ON" in this context.
Quoted 3 lines
GPIO pins should be made available to the kernel through
the GPIO subsystem; any clock configuration should be configured through the clock subsystem if needed.
I believe we will agree to disagree there. I find it more convenient (along with Markus, etc) to have clearly chip specific feature available for the chip in one place - especially when that follows the consistency - rather than distributed in several sub-spaces. Not that this is only a minor feature. Splitting them into even tinier is strange in my opinion.
Quoted 3 lines
The pin configuration as ALERT output/ALL_ON
input/clock is clearly board specific and should thus be provided as platform data and/or devicetree data if needed.
That is still static, not dynamic, hence inappropriate for the use case at hand.
Quoted 2 lines
The existing GPIO alarm attributes should be removed. The pin values should be reported as GPIO pin values instead.
Feel free to provide a change for review if you wish.
I would like to note that I am not planning to rewrite an already existing and tested feature as of now. Not sure if I could find the motivation and time for doing that any soon. To me, it only looks personal taste nitpicking so far, and the feature would be more important to me. There are pro/cons for both sides, but if this feature cannot get it in with this design, there might be no feature like this for the posterity.
So unless there are good arguments with modulo critical answers why it is unacceptably wrong as is for now, let us drop this change in upstream, then.
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
One week passed since the initial submit. Any feedback from the maintainer who accepts patches for this?
Quoted 81 lines · Laszlo Papp
Quoted 38 lines · Guenter Roeck
Quoted 37 lines · Guenter Roeck
Quoted 36 lines · Laszlo Papp
Quoted 24 lines · Marcus Folkesson
Quoted 7 lines
This is just one use case of those, you could also use it for non-generic gpio functionality, like alarm, "full-on", internal clock, external clock, etc. I believe it is always a bit tricky with MFD. I personally prefer to put it into the chip driver because this is not clearly a generic gpio interface here, and I need to drive it dynamically.
I agree.
I think the solution with expose the "GPIOs" in sysfs is the right way to go.
The chip-function is of a dynamic nature and should therefor not be set in platform data / devicetree.As mentioned before, GPIOs should use the gpio subsystem whenever possible, but the the gpio-functionality is just a subset of
functions these pins may be set to.Also, the I think the *real* reason why the entries is called "gpio" is that it is so the registers are are mentioned in the datasheet. Everyone that is working with the device will know what it is all about. I see it more as an register expose than a gpio interface...
Quoted 7 lines
I agree that the entries does not really fit here. But they does not fit better elsewhere either.
And I don't think they fit worse than the alarm-entries that is already in mainline.Anyway, I think the documentation file should mention what function each valid value represent.
Yes, makes sense to make the documentation more comprehensive. Thanks.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Any other issues from anyone before submitting a polished version?
You'll have to get feedback from Jean. I won't accept the patch.
To add to this: The datasheet clearly states that the pins are GPIO pins, three of which can be configured as ALERT output,
ALL_ONinput, or clock input/output.Which is inline with what we wrote before. Although, you probably meant
FULL_ONrather thanALL_ON. There is no "ALL_ON" in this context.Quoted 3 lines
GPIO pins should be made available to the kernel through
the GPIO subsystem; any clock configuration should be configured through the clock subsystem if needed.I believe we will agree to disagree there. I find it more convenient (along with Markus, etc) to have clearly chip specific feature available for the chip in one place - especially when that follows the consistency - rather than distributed in several sub-spaces. Not that this is only a minor feature. Splitting them into even tinier is strange in my opinion.
Quoted 3 lines
The pin configuration as ALERT output/ALL_ON
input/clock is clearly board specific and should thus be provided as platform data and/or devicetree data if needed.That is still static, not dynamic, hence inappropriate for the use case at hand.
Quoted 2 lines
The existing GPIO alarm attributes should be removed. The pin values should be reported as GPIO pin values instead.
Feel free to provide a change for review if you wish.
I would like to note that I am not planning to rewrite an already existing and tested feature as of now. Not sure if I could find the motivation and time for doing that any soon. To me, it only looks personal taste nitpicking so far, and the feature would be more important to me. There are pro/cons for both sides, but if this feature cannot get it in with this design, there might be no feature like this for the posterity.
Quoted 3 lines
So unless there are good arguments with modulo critical answers why it is unacceptably wrong as is for now, let us drop this change in upstream, then.
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerQuoted 3 lines · Laszlo Papp
One week passed since the initial submit. Any feedback from the maintainer who accepts patches for this?
Last time I checked that was either Jean Delvare or me.
As I already told you, I won't accept the patch as-is, and I told you what would need to be changed to have it accepted.
In general, we don't support adding non-standard sysfs attributes in hwmon drivers unless really needed and discussed. As I see it, there is no need for non-standard sysfs attributes in this driver; you _could_ use the gpio subsystem. You chose not to and provide non-standard sysfs attributes instead, essentially duplicating gpio subsystem functionality.
I see it as even more important to use the gpio subsystem for the intended use case, which is to use gpio pins for fan control. In that case, providing access through the gpio subsystem would enable using the gpio-fan driver to actually control the fans.
You may consider that to be personal taste nitpicking. I don't.
Guenter
Quoted 82 lines · Laszlo Papp
Quoted 81 lines · Guenter Roeck
Quoted 38 lines · Guenter Roeck
Quoted 37 lines · Laszlo Papp
Quoted 36 lines
Quoted 24 lines · Marcus Folkesson
Quoted 7 lines
This is just one use case of those, you could also use it for non-generic gpio functionality, like alarm, "full-on", internal clock, external clock, etc. I believe it is always a bit tricky with MFD. I personally prefer to put it into the chip driver because this is not clearly a generic gpio interface here, and I need to drive it dynamically.
I agree.
I think the solution with expose the "GPIOs" in sysfs is the right way to go.
The chip-function is of a dynamic nature and should therefor not be set in platform data / devicetree.As mentioned before, GPIOs should use the gpio subsystem whenever possible, but the the gpio-functionality is just a subset of
functions these pins may be set to.Also, the I think the *real* reason why the entries is called "gpio" is that it is so the registers are are mentioned in the datasheet. Everyone that is working with the device will know what it is all about. I see it more as an register expose than a gpio interface...
Quoted 7 lines
I agree that the entries does not really fit here. But they does not fit better elsewhere either.
And I don't think they fit worse than the alarm-entries that is already in mainline.Anyway, I think the documentation file should mention what function each valid value represent.
Yes, makes sense to make the documentation more comprehensive. Thanks.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Any other issues from anyone before submitting a polished version?
You'll have to get feedback from Jean. I won't accept the patch.
To add to this: The datasheet clearly states that the pins are GPIO pins, three of which can be configured as ALERT output,
ALL_ONinput, or clock input/output.Which is inline with what we wrote before. Although, you probably meant
FULL_ONrather thanALL_ON. There is no "ALL_ON" in this context.Quoted 3 lines
GPIO pins should be made available to the kernel through
the GPIO subsystem; any clock configuration should be configured through the clock subsystem if needed.I believe we will agree to disagree there. I find it more convenient (along with Markus, etc) to have clearly chip specific feature available for the chip in one place - especially when that follows the consistency - rather than distributed in several sub-spaces. Not that this is only a minor feature. Splitting them into even tinier is strange in my opinion.
Quoted 3 lines
The pin configuration as ALERT output/ALL_ON
input/clock is clearly board specific and should thus be provided as platform data and/or devicetree data if needed.That is still static, not dynamic, hence inappropriate for the use case at hand.
Quoted 2 lines
The existing GPIO alarm attributes should be removed. The pin values should be reported as GPIO pin values instead.
Feel free to provide a change for review if you wish.
I would like to note that I am not planning to rewrite an already existing and tested feature as of now. Not sure if I could find the motivation and time for doing that any soon. To me, it only looks personal taste nitpicking so far, and the feature would be more important to me. There are pro/cons for both sides, but if this feature cannot get it in with this design, there might be no feature like this for the posterity.
Quoted 4 lines
Quoted 3 lines
So unless there are good arguments with modulo critical answers why it is unacceptably wrong as is for now, let us drop this change in upstream, then.
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 6 lines · Guenter Roeck
Quoted 3 lines · Laszlo Papp
One week passed since the initial submit. Any feedback from the maintainer who accepts patches for this?
Last time I checked that was either Jean Delvare or me.
Quoted 8 lines
As I already told you, I won't accept the patch as-is, and I told you what would need to be changed to have it accepted.
In general, we don't support adding non-standard sysfs attributes in hwmon drivers unless really needed and discussed. As I see it, there is no need for non-standard sysfs attributes in this driver; you _could_ use the gpio subsystem. You chose not to and provide non-standard sysfs attributes instead, essentially duplicating gpio subsystem functionality.
MFD != gpio subsystem, but for some reason or another you continuously overlook that. You also disregard what Markus wrote: this change is just following the existing convention in there. Basically, your suggestion would lead to a mixed interface where some feature of the chip is exposed in 3-4 other places, and some centrally and in a compact manner in hwmon.
Quoted 4 lines
I see it as even more important to use the gpio subsystem for the intended use case, which is to use gpio pins for fan control. In that case, providing access through the gpio subsystem would enable using the gpio-fan driver to actually control the fans.
That is clearly incorrect. To write a proper userspace middleware would imply fishing stuff from several subspaces rather than using the same compact interface. I called that a nightmare from end user point of view.
Quoted 1 line
You may consider that to be personal taste nitpicking. I don't.
I consider it worse than nitpicking eventually: imho, it is rejecting a validated feature without providing a better change. It is a shame, but we cannot do anything more at this point to provide remedy here without getting financial loss, further time spent on a full rewrite, and relevant study, etc. The kernel will remain without this feature probably. I see it as a loss/loss for both parties. You will save maintaining it (even though it is me who would probably need to maintain this feature for the next few years...) for the cost of not having the feature at all, most likely.
Well, I guess we will need to stick to a more feature-rich forked version for us then.
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Just to clarify: you want to have ./gpio/gpio-max6650.c?
Quoted 45 lines · Laszlo Papp
Quoted 6 lines · Guenter Roeck
Quoted 3 lines · Laszlo Papp
One week passed since the initial submit. Any feedback from the maintainer who accepts patches for this?
Last time I checked that was either Jean Delvare or me.
Quoted 8 lines
As I already told you, I won't accept the patch as-is, and I told you what would need to be changed to have it accepted.
In general, we don't support adding non-standard sysfs attributes in hwmon drivers unless really needed and discussed. As I see it, there is no need for non-standard sysfs attributes in this driver; you _could_ use the gpio subsystem. You chose not to and provide non-standard sysfs attributes instead, essentially duplicating gpio subsystem functionality.
MFD != gpio subsystem, but for some reason or another you continuously overlook that. You also disregard what Markus wrote: this change is just following the existing convention in there. Basically, your suggestion would lead to a mixed interface where some feature of the chip is exposed in 3-4 other places, and some centrally and in a compact manner in hwmon.
Quoted 4 lines
I see it as even more important to use the gpio subsystem for the intended use case, which is to use gpio pins for fan control. In that case, providing access through the gpio subsystem would enable using the gpio-fan driver to actually control the fans.
That is clearly incorrect. To write a proper userspace middleware would imply fishing stuff from several subspaces rather than using the same compact interface. I called that a nightmare from end user point of view.
Quoted 1 line
You may consider that to be personal taste nitpicking. I don't.
I consider it worse than nitpicking eventually: imho, it is rejecting a validated feature without providing a better change. It is a shame, but we cannot do anything more at this point to provide remedy here without getting financial loss, further time spent on a full rewrite, and relevant study, etc. The kernel will remain without this feature probably. I see it as a loss/loss for both parties. You will save maintaining it (even though it is me who would probably need to maintain this feature for the next few years...) for the cost of not having the feature at all, most likely.
Quoted 2 lines
Well, I guess we will need to stick to a more feature-rich forked version for us then.
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerQuoted 2 lines · Laszlo Papp
Just to clarify: you want to have
./gpio/gpio-max6650.c?
No, I never said that. I wanted you to register the gpio pins with the gpio subsystem. I didn't ask you to write a separate driver for it.
Sure, strictly speaking one could write a top level mfd driver and separate gpio and hwmon drivers, but at least in my opinion that would be overkill. I also never suggested this; you brought the term mfd into the discussion.
Guenter
Quoted 46 lines · Laszlo Papp
Quoted 45 lines · Guenter Roeck
Quoted 6 lines · Laszlo Papp
Quoted 3 lines
One week passed since the initial submit. Any feedback from the maintainer who accepts patches for this?
Last time I checked that was either Jean Delvare or me.
Quoted 8 lines
As I already told you, I won't accept the patch as-is, and I told you what would need to be changed to have it accepted.
In general, we don't support adding non-standard sysfs attributes in hwmon drivers unless really needed and discussed. As I see it, there is no need for non-standard sysfs attributes in this driver; you _could_ use the gpio subsystem. You chose not to and provide non-standard sysfs attributes instead, essentially duplicating gpio subsystem functionality.
MFD != gpio subsystem, but for some reason or another you continuously overlook that. You also disregard what Markus wrote: this change is just following the existing convention in there. Basically, your suggestion would lead to a mixed interface where some feature of the chip is exposed in 3-4 other places, and some centrally and in a compact manner in hwmon.
Quoted 4 lines
I see it as even more important to use the gpio subsystem for the intended use case, which is to use gpio pins for fan control. In that case, providing access through the gpio subsystem would enable using the gpio-fan driver to actually control the fans.
That is clearly incorrect. To write a proper userspace middleware would imply fishing stuff from several subspaces rather than using the same compact interface. I called that a nightmare from end user point of view.
Quoted 1 line
You may consider that to be personal taste nitpicking. I don't.
I consider it worse than nitpicking eventually: imho, it is rejecting a validated feature without providing a better change. It is a shame, but we cannot do anything more at this point to provide remedy here without getting financial loss, further time spent on a full rewrite, and relevant study, etc. The kernel will remain without this feature probably. I see it as a loss/loss for both parties. You will save maintaining it (even though it is me who would probably need to maintain this feature for the next few years...) for the cost of not having the feature at all, most likely.
Quoted 4 lines
Quoted 2 lines
Well, I guess we will need to stick to a more feature-rich forked version for us then.
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 4 lines · Guenter Roeck
Quoted 3 lines · Laszlo Papp
Just to clarify: you want to have
./gpio/gpio-max6650.c?
Quoted 8 lines
No, I never said that. I wanted you to register the gpio pins with the gpio subsystem. I didn't ask you to write a separate driver for it.
Sure, strictly speaking one could write a top level mfd driver and separate gpio and hwmon drivers, but at least in my opinion that would be overkill. I also never suggested this; you brought the term mfd into the discussion.
Why is it an overkill to write a separate gpio driver for this, and potentially also for the gpio status register of this particular MAXIM chip?
Other gpio drivers in the gpio folder are also short. This would not become long either.
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerQuoted 14 lines · Laszlo Papp
Quoted 4 lines · Guenter Roeck
Quoted 3 lines · Laszlo Papp
Just to clarify: you want to have
./gpio/gpio-max6650.c?Quoted 8 lines
No, I never said that. I wanted you to register the gpio pins with the gpio subsystem. I didn't ask you to write a separate driver for it.
Sure, strictly speaking one could write a top level mfd driver and separate gpio and hwmon drivers, but at least in my opinion that would be overkill. I also never suggested this; you brought the term mfd into the discussion.
Quoted 7 lines
Why is it an overkill to write a separate gpio driver for this, and potentially also for the gpio status register of this particular MAXIM chip?
Other gpio drivers in the gpio folder are also short. This would not become long either.
No one prevents you from writing a separate gpio driver. I will certainly not prevent you from doing it. Just don't claim that I requested it. Same is true for an mfd driver; I won't prevent you from writing one. But don't claim that I told you to do it.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 19 lines · Guenter Roeck
Quoted 18 lines · Laszlo Papp
Quoted 4 lines · Guenter Roeck
Quoted 3 lines · Laszlo Papp
Just to clarify: you want to have
./gpio/gpio-max6650.c?Quoted 8 lines
No, I never said that. I wanted you to register the gpio pins with the gpio subsystem. I didn't ask you to write a separate driver for it.
Sure, strictly speaking one could write a top level mfd driver and separate gpio and hwmon drivers, but at least in my opinion that would be overkill. I also never suggested this; you brought the term mfd into the discussion.
Why is it an overkill to write a separate gpio driver for this, and potentially also for the gpio status register of this particular MAXIM chip?
Quoted 7 lines
Quoted 3 lines
Other gpio drivers in the gpio folder are also short. This would not become long either.
No one prevents you from writing a separate gpio driver. I will certainly not prevent you from doing it. Just don't claim that I requested it. Same is true for an mfd driver; I won't prevent you from writing one. But don't claim that I told you to do it.
I am not sure if you are trying to claim that with this statement a separate gpio driver would be acceptable, but it would require a bit more work, or whether that you would reject such a driver added.
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerQuoted 23 lines · Laszlo Papp
Quoted 22 lines · Guenter Roeck
Quoted 21 lines · Laszlo Papp
Quoted 4 lines · Guenter Roeck
Quoted 3 lines · Laszlo Papp
Just to clarify: you want to have
./gpio/gpio-max6650.c?Quoted 8 lines
No, I never said that. I wanted you to register the gpio pins with the gpio subsystem. I didn't ask you to write a separate driver for it.
Sure, strictly speaking one could write a top level mfd driver and separate gpio and hwmon drivers, but at least in my opinion that would be overkill. I also never suggested this; you brought the term mfd into the discussion.
Why is it an overkill to write a separate gpio driver for this, and potentially also for the gpio status register of this particular MAXIM chip?
Other gpio drivers in the gpio folder are also short. This would not become long either.
Quoted 9 lines
Quoted 4 lines
No one prevents you from writing a separate gpio driver. I will certainly not prevent you from doing it. Just don't claim that I requested it. Same is true for an mfd driver; I won't prevent you from writing one. But don't claim that I told you to do it.
I am not sure if you are trying to claim that with this statement a separate gpio driver would be acceptable, but it would require a bit more work, or whether that you would reject such a driver added.
Please explain, for my education, what makes you believe that I would object to or reject to anyone submitting such a driver.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 29 lines · Guenter Roeck
Quoted 28 lines · Laszlo Papp
Quoted 26 lines · Guenter Roeck
Quoted 14 lines · Laszlo Papp
Quoted 4 lines · Guenter Roeck
Quoted 3 lines · Laszlo Papp
Just to clarify: you want to have
./gpio/gpio-max6650.c?Quoted 8 lines
No, I never said that. I wanted you to register the gpio pins with the gpio subsystem. I didn't ask you to write a separate driver for it.
Sure, strictly speaking one could write a top level mfd driver and separate gpio and hwmon drivers, but at least in my opinion that would be overkill. I also never suggested this; you brought the term mfd into the discussion.
Quoted 7 lines
Why is it an overkill to write a separate gpio driver for this, and potentially also for the gpio status register of this particular MAXIM chip?
Other gpio drivers in the gpio folder are also short. This would not become long either.
No one prevents you from writing a separate gpio driver. I will certainly not prevent you from doing it. Just don't claim that I requested it. Same is true for an mfd driver; I won't prevent you from writing one. But don't claim that I told you to do it.
Quoted 6 lines
Quoted 4 lines
I am not sure if you are trying to claim that with this statement a separate gpio driver would be acceptable, but it would require a bit more work, or whether that you would reject such a driver added.
Please explain, for my education, what makes you believe that I would object to or reject to anyone submitting such a driver.
After the current objection, I am not sure anymore. I thought the last change would have been just as acceptable. ;-)
So, in short, I would not like to waste more time with unacceptable approaches for the maintainer. Anyway, if you feel happy about accepting such an approach once stabilized, I think I will go for that.
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
So, Mr. Roeck, how do you suggest to handle input or output port configuration? Should it be coming from platform data, or should it be more dynamic? I would say, it is usually static, but I do not know if it is common to be dynamic. I am not a hardware designer.
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerQuoted 5 lines · Laszlo Papp
So, Mr. Roeck, how do you suggest to handle input or output port configuration? Should it be coming from platform data, or should it be more dynamic? I would say, it is usually static, but I do not know if it is common to be dynamic. I am not a hardware designer.
Platform and/or devicetree.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 8 lines · Guenter Roeck
Quoted 5 lines · Laszlo Papp
So, Mr. Roeck, how do you suggest to handle input or output port configuration? Should it be coming from platform data, or should it be more dynamic? I would say, it is usually static, but I do not know if it is common to be dynamic. I am not a hardware designer.
Platform and/or devicetree.
Works for me. Should I apply the gpio and mfd drivers separately or in one single patch?
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 8 lines · Laszlo Papp
Quoted 7 lines · Guenter Roeck
Quoted 5 lines · Laszlo Papp
So, Mr. Roeck, how do you suggest to handle input or output port configuration? Should it be coming from platform data, or should it be more dynamic? I would say, it is usually static, but I do not know if it is common to be dynamic. I am not a hardware designer.
Quoted 4 lines
Quoted 1 line
Platform and/or devicetree.
Works for me. Should I apply the gpio and mfd drivers separately or in one single patch?
s/apply/send/
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerQuoted 9 lines · Laszlo Papp
Quoted 8 lines · Laszlo Papp
Quoted 7 lines · Guenter Roeck
Quoted 5 lines · Laszlo Papp
So, Mr. Roeck, how do you suggest to handle input or output port configuration? Should it be coming from platform data, or should it be more dynamic? I would say, it is usually static, but I do not know if it is common to be dynamic. I am not a hardware designer.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Platform and/or devicetree.
Works for me. Should I apply the gpio and mfd drivers separately or in one single patch?
s/apply/send/
Separately.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors