Skip to contentSkip to conversation

hwmon/pmbus/delta:new driver for Delta modules Q54SJ108A2 The driver is used for Q54SJ108A2 series of Delta. Signed-off-by: xiao.mx.ma <[email protected]>

PATCH Guenter Roeck 1 participant 1 message Aug 24, 2020 1 message not in the archive Hardware monitoring

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Guenter Roeck

author maintainer
#1 lore raw
Quoted 2 lines · Xiao.MX.Ma 馬驍

The driver is used for Q54SJ108A2 series of Delta.

Submission on top of the previous patch instead of a clean v2, subject still starting with [PATCH]{PATCH], no change log, delta_read_word_data() and delta_read_byte_data() still as unnecessary as before, and, worst of all, "is for the sole use of the intended recipient(s) and may contain confidential and privileged information" trailer.

I should not even reply to this e-mail. Please study and follow Documentation/hwmon/submitting-patches.rst and documents referenced therein before resubmitting.

Thanks,
Guenter

Quoted 189 lines
---
 drivers/hwmon/pmbus/Kconfig                   | 18 +++---
 drivers/hwmon/pmbus/Makefile                  |  2 +-
 drivers/hwmon/pmbus/{Q54SJ108A2.c => delta.c} | 57 +------------------
 3 files changed, 12 insertions(+), 65 deletions(-)
 rename drivers/hwmon/pmbus/{Q54SJ108A2.c => delta.c} (83%)
drivers/hwmon/pmbus/Kconfig +9 -9
index b4bd6ac491c8..9057459bc31d 100644
@@ -45,6 +45,15 @@ config SENSORS_BEL_PFE
    This driver can also be built as a module. If so, the module will
    be called bel-pfe.
 
+config SENSORS_DELTA
+ tristate "Delta Q54SJ108A2"
+ help
+   If you say yes here you get hardware monitoring support for Delta modules
+   Q54SJ108A2.
+
+   This driver can also be built as a module. If so, the module will
+   be called delta.
+
 config SENSORS_IBM_CFFPS
  tristate "IBM Common Form Factor Power Supply"
  depends on LEDS_CLASS
@@ -209,15 +218,6 @@ config SENSORS_PXE1610
    This driver can also be built as a module. If so, the module will
    be called pxe1610.
 
-config SENSORS_Q54SJ108A2
- tristate "Delta Q54SJ108A2"
- help
-   If you say yes here you get hardware monitoring support for Delta modules
-   Q54SJ108A2.
-
-   This driver can also be built as a module. If so, the module will
-   be called Q54SJ108A2.
-
 config SENSORS_TPS40422
  tristate "TI TPS40422"
  help
drivers/hwmon/pmbus/Makefile +1 -1
index 4536c57ef1a4..7da971e2143c 100644
@@ -30,4 +30,4 @@ obj-$(CONFIG_SENSORS_UCD9000) += ucd9000.o
 obj-$(CONFIG_SENSORS_UCD9200) += ucd9200.o
 obj-$(CONFIG_SENSORS_XDPE122) += xdpe12284.o
 obj-$(CONFIG_SENSORS_ZL6100) += zl6100.o
-obj-$(CONFIG_SENSORS_Q54SJ108A2) += Q54SJ108A2.o
+obj-$(CONFIG_SENSORS_DELTA) += delta.o
drivers/hwmon/pmbus/delta.c renamed from drivers/hwmon/pmbus/Q54SJ108A2.c +2 -56
similarity index 83%
rename from drivers/hwmon/pmbus/Q54SJ108A2.c
rename to drivers/hwmon/pmbus/delta.c
index 67fac5506763..ccef5704920f 100644
@@ -40,13 +40,10 @@ enum chips {
 static int delta_read_word_data(struct i2c_client *client, int page, int phase, int reg)
 {
  int ret = 0;
- u16 temp;
-
- temp = pmbus_read_word_data(client, page, phase, reg);
 
  switch (reg) {
  case PMBUS_STATUS_WORD:
- ret = temp;
+ ret = pmbus_read_word_data(client, page, phase, reg);
  break;
  default:
  ret = -ENODATA;
@@ -56,30 +53,9 @@ static int delta_read_word_data(struct i2c_client *client, int page, int phase,
 
 }
 
-static int delta_write_word_data(struct i2c_client *client, int page, int reg, u16 word)
-{
- u8 value;
-
- switch (reg) {
- case PMBUS_OPERATION:
- case PMBUS_WRITE_PROTECT:
- case PMBUS_VOUT_OV_FAULT_RESPONSE:
- case PMBUS_IOUT_OC_FAULT_RESPONSE:
- value = (u8)word;
- return pmbus_write_byte_data(client, page, reg, value);
-
- default:
- return -ENODATA;
- }
-
-}
-
 static int delta_read_byte_data(struct i2c_client *client, int page, int reg)
 {
  int ret = 0;
- u16 temp;
-
- temp = pmbus_read_byte_data(client, page, reg);
 
  switch (reg) {
  case PMBUS_OPERATION:
@@ -93,7 +69,7 @@ static int delta_read_byte_data(struct i2c_client *client, int page, int reg)
  case PMBUS_STATUS_TEMPERATURE:
  case PMBUS_STATUS_CML:
  case PMBUS_REVISION:
- ret = temp;
+ ret = pmbus_read_byte_data(client, page, reg);
  break;
 
  default:
@@ -104,20 +80,6 @@ static int delta_read_byte_data(struct i2c_client *client, int page, int reg)
 
 }
 
-static int delta_write_byte(struct i2c_client *client, int page, u8 value)
-{
- switch (value) {
- case PMBUS_CLEAR_FAULTS:
- ret = pmbus_write_byte(client, page, PMBUS_CLEAR_FAULTS);
- break;
-
- default:
- ret = -ENODATA;
- break;
- }
- return ret;
-}
-
 static const struct pmbus_driver_info delta_info[] = {
 
 [Q54SJ108A2] = {
@@ -126,13 +88,8 @@ static const struct pmbus_driver_info delta_info[] = {
 
 .read_word_data = delta_read_word_data,
 
-.write_word_data = delta_write_word_data,
-
 .read_byte_data = delta_read_byte_data,
 
-.write_byte = delta_write_byte,
-
-
 /* Source : Delta Q54SJ108A2 */
 
 .format[PSC_TEMPERATURE] = linear,
@@ -160,13 +117,8 @@ PMBUS_HAVE_STATUS_INPUT,
 
 .read_word_data = delta_read_word_data,
 
-.write_word_data = delta_write_word_data,
-
 .read_byte_data = delta_read_byte_data,
 
-.write_byte = delta_write_byte,
-
-
 /* Source : Delta Q50SN12050 */
 
 .format[PSC_TEMPERATURE] = linear,
@@ -195,13 +147,8 @@ PMBUS_HAVE_STATUS_INPUT,
 
 .read_word_data = delta_read_word_data,
 
-.write_word_data = delta_write_word_data,
-
 .read_byte_data = delta_read_byte_data,
 
-.write_byte = delta_write_byte,
-
-
 /* Source : Delta Q50SN12072 */
 
 .format[PSC_TEMPERATURE] = linear,
--

2.20.1

*************************************************************************
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. [Delta Electronics, INC. China]
*************************************************************************