Merge tag 'tags/tcpm-pps-4.18' into psy-next
authorSebastian Reichel <sre@kernel.org>
Thu, 26 Apr 2018 10:18:30 +0000 (12:18 +0200)
committerSebastian Reichel <sre@kernel.org>
Thu, 26 Apr 2018 10:18:30 +0000 (12:18 +0200)
Tag/Merge point for adding typeC power supply support

This is a signed tag/merge point to handle the cross-tree merge of the
USB and power supply subsystems for the patch series:
Subject: [PATCH v8 0/6] typec: tcpm: Add sink side support for PPS

It is based on the usb.git tree, in the usb-next branch, for merging in
4.18-rc1.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
1  2 
MAINTAINERS
drivers/power/supply/power_supply_sysfs.c

diff --cc MAINTAINERS
Simple merge
@@@ -97,43 -137,35 +137,48 @@@ static ssize_t power_supply_show_proper
                }
        }
  
 -      if (off == POWER_SUPPLY_PROP_STATUS)
 -              return sprintf(buf, "%s\n",
 -                             power_supply_status_text[value.intval]);
 -      else if (off == POWER_SUPPLY_PROP_CHARGE_TYPE)
 -              return sprintf(buf, "%s\n",
 -                             power_supply_charge_type_text[value.intval]);
 -      else if (off == POWER_SUPPLY_PROP_HEALTH)
 -              return sprintf(buf, "%s\n",
 -                             power_supply_health_text[value.intval]);
 -      else if (off == POWER_SUPPLY_PROP_TECHNOLOGY)
 -              return sprintf(buf, "%s\n",
 -                             power_supply_technology_text[value.intval]);
 -      else if (off == POWER_SUPPLY_PROP_CAPACITY_LEVEL)
 -              return sprintf(buf, "%s\n",
 -                             power_supply_capacity_level_text[value.intval]);
 -      else if (off == POWER_SUPPLY_PROP_TYPE)
 -              return sprintf(buf, "%s\n",
 -                             power_supply_type_text[value.intval]);
 -      else if (off == POWER_SUPPLY_PROP_USB_TYPE)
 -              return power_supply_show_usb_type(dev, psy->desc->usb_types,
 -                                                psy->desc->num_usb_types,
 -                                                &value, buf);
 -      else if (off == POWER_SUPPLY_PROP_SCOPE)
 -              return sprintf(buf, "%s\n",
 -                             power_supply_scope_text[value.intval]);
 -      else if (off >= POWER_SUPPLY_PROP_MODEL_NAME)
 -              return sprintf(buf, "%s\n", value.strval);
 -
 -      return sprintf(buf, "%d\n", value.intval);
 +      switch (psp) {
 +      case POWER_SUPPLY_PROP_STATUS:
 +              ret = sprintf(buf, "%s\n",
 +                            power_supply_status_text[value.intval]);
 +              break;
 +      case POWER_SUPPLY_PROP_CHARGE_TYPE:
 +              ret = sprintf(buf, "%s\n",
 +                            power_supply_charge_type_text[value.intval]);
 +              break;
 +      case POWER_SUPPLY_PROP_HEALTH:
 +              ret = sprintf(buf, "%s\n",
 +                            power_supply_health_text[value.intval]);
 +              break;
 +      case POWER_SUPPLY_PROP_TECHNOLOGY:
 +              ret = sprintf(buf, "%s\n",
 +                            power_supply_technology_text[value.intval]);
 +              break;
 +      case POWER_SUPPLY_PROP_CAPACITY_LEVEL:
 +              ret = sprintf(buf, "%s\n",
 +                            power_supply_capacity_level_text[value.intval]);
 +              break;
 +      case POWER_SUPPLY_PROP_TYPE:
 +              ret = sprintf(buf, "%s\n",
 +                            power_supply_type_text[value.intval]);
 +              break;
++      case POWER_SUPPLY_PROP_USB_TYPE:
++              ret = power_supply_show_usb_type(dev, psy->desc->usb_types,
++                                               psy->desc->num_usb_types,
++                                               &value, buf);
++              break;
 +      case POWER_SUPPLY_PROP_SCOPE:
 +              ret = sprintf(buf, "%s\n",
 +                            power_supply_scope_text[value.intval]);
 +              break;
 +      case POWER_SUPPLY_PROP_MODEL_NAME ... POWER_SUPPLY_PROP_SERIAL_NUMBER:
 +              ret = sprintf(buf, "%s\n", value.strval);
 +              break;
 +      default:
 +              ret = sprintf(buf, "%d\n", value.intval);
 +      }
 +
 +      return ret;
  }
  
  static ssize_t power_supply_store_property(struct device *dev,