mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
USB/PHY patches for 4.18-rc1
Here is the big USB pull request for 4.18-rc1. Lots of stuff here, the highlights are: - phy driver updates and new additions - usual set of xhci driver updates - normal set of musb updates - gadget driver updates and new controllers - typec work, it's getting closer to getting fully out of the staging portion of the tree. - lots of minor cleanups and bugfixes. All of these have been in linux-next for a while with no reported issues. Signed-off-by: Greg Kroah-Hartman <[email protected]> -----BEGIN PGP SIGNATURE----- iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCWxba6w8cZ3JlZ0Brcm9h aC5jb20ACgkQMUfUDdst+ykumQCg2abWE5LijR0SNJIwX8xk64HLUAMAnAxBZDG3 aB0GyOQd54L+09q4LAdn =ZCEx -----END PGP SIGNATURE----- Merge tag 'usb-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB and PHY updates from Greg KH: "Here is the big USB pull request for 4.18-rc1. Lots of stuff here, the highlights are: - phy driver updates and new additions - usual set of xhci driver updates - normal set of musb updates - gadget driver updates and new controllers - typec work, it's getting closer to getting fully out of the staging portion of the tree. - lots of minor cleanups and bugfixes. All of these have been in linux-next for a while with no reported issues" * tag 'usb-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (263 commits) Revert "xhci: Reset Renesas uPD72020x USB controller for 32-bit DMA issue" xhci: Add quirk to zero 64bit registers on Renesas PCIe controllers xhci: Allow more than 32 quirks usb: xhci: force all memory allocations to node selftests: add test for USB over IP driver USB: typec: fsusb302: no need to check return value of debugfs_create_dir() USB: gadget: udc: s3c2410_udc: no need to check return value of debugfs_create functions USB: gadget: udc: renesas_usb3: no need to check return value of debugfs_create functions USB: gadget: udc: pxa27x_udc: no need to check return value of debugfs_create functions USB: gadget: udc: gr_udc: no need to check return value of debugfs_create functions USB: gadget: udc: bcm63xx_udc: no need to check return value of debugfs_create functions USB: udc: atmel_usba_udc: no need to check return value of debugfs_create functions USB: dwc3: no need to check return value of debugfs_create functions USB: dwc2: no need to check return value of debugfs_create functions USB: core: no need to check return value of debugfs_create functions USB: chipidea: no need to check return value of debugfs_create functions USB: ehci-hcd: no need to check return value of debugfs_create functions USB: fhci-hcd: no need to check return value of debugfs_create functions USB: fotg210-hcd: no need to check return value of debugfs_create functions USB: imx21-hcd: no need to check return value of debugfs_create functions ...
This commit is contained in:
commit
07c4dd3435
211 changed files with 11404 additions and 3486 deletions
|
|
@ -19,6 +19,7 @@
|
|||
#include <linux/err.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/power_supply.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/thermal.h>
|
||||
#include "power_supply.h"
|
||||
|
||||
|
|
@ -843,12 +844,21 @@ __power_supply_register(struct device *parent,
|
|||
{
|
||||
struct device *dev;
|
||||
struct power_supply *psy;
|
||||
int rc;
|
||||
int i, rc;
|
||||
|
||||
if (!parent)
|
||||
pr_warn("%s: Expected proper parent device for '%s'\n",
|
||||
__func__, desc->name);
|
||||
|
||||
if (!desc || !desc->name || !desc->properties || !desc->num_properties)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
for (i = 0; i < desc->num_properties; ++i) {
|
||||
if ((desc->properties[i] == POWER_SUPPLY_PROP_USB_TYPE) &&
|
||||
(!desc->usb_types || !desc->num_usb_types))
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
psy = kzalloc(sizeof(*psy), GFP_KERNEL);
|
||||
if (!psy)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
|
@ -865,7 +875,8 @@ __power_supply_register(struct device *parent,
|
|||
psy->desc = desc;
|
||||
if (cfg) {
|
||||
psy->drv_data = cfg->drv_data;
|
||||
psy->of_node = cfg->of_node;
|
||||
psy->of_node =
|
||||
cfg->fwnode ? to_of_node(cfg->fwnode) : cfg->of_node;
|
||||
psy->supplied_to = cfg->supplied_to;
|
||||
psy->num_supplicants = cfg->num_supplicants;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,11 @@ static const char * const power_supply_type_text[] = {
|
|||
"USB_PD", "USB_PD_DRP", "BrickID"
|
||||
};
|
||||
|
||||
static const char * const power_supply_usb_type_text[] = {
|
||||
"Unknown", "SDP", "DCP", "CDP", "ACA", "C",
|
||||
"PD", "PD_DRP", "PD_PPS", "BrickID"
|
||||
};
|
||||
|
||||
static const char * const power_supply_status_text[] = {
|
||||
"Unknown", "Charging", "Discharging", "Not charging", "Full"
|
||||
};
|
||||
|
|
@ -73,6 +78,41 @@ static const char * const power_supply_scope_text[] = {
|
|||
"Unknown", "System", "Device"
|
||||
};
|
||||
|
||||
static ssize_t power_supply_show_usb_type(struct device *dev,
|
||||
enum power_supply_usb_type *usb_types,
|
||||
ssize_t num_usb_types,
|
||||
union power_supply_propval *value,
|
||||
char *buf)
|
||||
{
|
||||
enum power_supply_usb_type usb_type;
|
||||
ssize_t count = 0;
|
||||
bool match = false;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_usb_types; ++i) {
|
||||
usb_type = usb_types[i];
|
||||
|
||||
if (value->intval == usb_type) {
|
||||
count += sprintf(buf + count, "[%s] ",
|
||||
power_supply_usb_type_text[usb_type]);
|
||||
match = true;
|
||||
} else {
|
||||
count += sprintf(buf + count, "%s ",
|
||||
power_supply_usb_type_text[usb_type]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!match) {
|
||||
dev_warn(dev, "driver reporting unsupported connected type\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (count)
|
||||
buf[count - 1] = '\n';
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t power_supply_show_property(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf) {
|
||||
|
|
@ -115,6 +155,10 @@ static ssize_t power_supply_show_property(struct device *dev,
|
|||
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]);
|
||||
|
|
@ -241,6 +285,7 @@ static struct device_attribute power_supply_attrs[] = {
|
|||
POWER_SUPPLY_ATTR(time_to_full_now),
|
||||
POWER_SUPPLY_ATTR(time_to_full_avg),
|
||||
POWER_SUPPLY_ATTR(type),
|
||||
POWER_SUPPLY_ATTR(usb_type),
|
||||
POWER_SUPPLY_ATTR(scope),
|
||||
POWER_SUPPLY_ATTR(precharge_current),
|
||||
POWER_SUPPLY_ATTR(charge_term_current),
|
||||
|
|
|
|||
Loading…
Reference in a new issue