Skip to content

Commit 72486eb

Browse files
committed
Merge tag 'extcon-next-for-6.12' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next
Chanwoo writes: Update extcon next for v6.12 Detailed description for this pull request: - Add missing child node port on exttcon-ptn5150 binding document - Convert extcon-usb-gpio.txt to yaml format for binding document - Add new LC824206XA microUSB switch driver : Add a new driver for the ON Semiconductor LC824206XA microUSB switch and accessory detector chip. It has been tested on a Lenovo Yoga Tablet 2 Pro 1380. And this driver is only used on x86/ACPI (non devicetree) devices, Therefor there is no devicetree bindings documentation. - Apply immutable branch between power_supply and extcon tree for extcon-lc824206xa.c * tag 'extcon-next-for-6.12' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon: extcon: lc824206xa: Fix build error of POWER_SUPPLY_PROP_USB_TYPE dt-bindings: extcon: convert extcon-usb-gpio.txt to yaml format dt-bindings: extcon: ptn5150: add child node port extcon: Add LC824206XA microUSB switch driver power: supply: Change usb_types from an array into a bitmask power: supply: sysfs: Move power_supply_show_enum_with_available() up power: supply: sysfs: Add power_supply_show_enum_with_available() helper power: supply: rt9467-charger: Remove "usb_type" property write support power: supply: ucs1002: Adjust ucs1002_set_usb_type() to accept string values power: supply: "usb_type" property may be written to
2 parents ba26342 + 2e01ac8 commit 72486eb

31 files changed

+687
-275
lines changed

Documentation/ABI/testing/sysfs-class-power

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,12 @@ Description:
592592
the supply, for example it can show if USB-PD capable source
593593
is attached.
594594

595-
Access: Read-Only
595+
Access: For power-supplies which consume USB power such
596+
as battery charger chips, this indicates the type of
597+
the connected USB power source and is Read-Only.
598+
599+
For power-supplies which act as a USB power-source such as
600+
e.g. the UCS1002 USB Port Power Controller this is writable.
596601

597602
Valid values:
598603
"Unknown", "SDP", "DCP", "CDP", "ACA", "C", "PD",

Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ properties:
3737
GPIO pin (output) used to control VBUS. If skipped, no such control
3838
takes place.
3939

40+
port:
41+
$ref: /schemas/graph.yaml#/properties/port
42+
description:
43+
A port node to link the usb controller for the dual role switch.
44+
4045
required:
4146
- compatible
4247
- interrupts
@@ -58,5 +63,11 @@ examples:
5863
interrupt-parent = <&msmgpio>;
5964
interrupts = <78 IRQ_TYPE_LEVEL_HIGH>;
6065
vbus-gpios = <&msmgpio 148 GPIO_ACTIVE_HIGH>;
66+
67+
port {
68+
endpoint {
69+
remote-endpoint = <&usb1_drd_sw>;
70+
};
71+
};
6172
};
6273
};

Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/extcon/linux,extcon-usb-gpio.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: USB GPIO Extcon device
8+
9+
maintainers:
10+
- Frank Li <[email protected]>
11+
12+
description:
13+
This is a virtual device used to generate USB cable states from the USB ID pin
14+
connected to a GPIO pin.
15+
16+
properties:
17+
compatible:
18+
const: linux,extcon-usb-gpio
19+
20+
id-gpios:
21+
description: gpio for USB ID pin. See gpio binding.
22+
vbus-gpios:
23+
description: gpio for USB VBUS pin.
24+
25+
required:
26+
- compatible
27+
28+
additionalProperties: false
29+
30+
examples:
31+
- |
32+
#include <dt-bindings/gpio/gpio.h>
33+
34+
extcon_usb1 {
35+
compatible = "linux,extcon-usb-gpio";
36+
id-gpios = <&gpio6 1 GPIO_ACTIVE_HIGH>;
37+
};

drivers/extcon/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,17 @@ config EXTCON_INTEL_MRFLD
7575
Say Y here to enable extcon support for charger detection / control
7676
on the Intel Merrifield Basin Cove PMIC.
7777

78+
config EXTCON_LC824206XA
79+
tristate "LC824206XA extcon Support"
80+
depends on I2C
81+
depends on POWER_SUPPLY
82+
help
83+
Say Y here to enable support for the ON Semiconductor LC824206XA
84+
microUSB switch and accessory detector chip. The LC824206XA is a USB
85+
port accessory detector and switch. The LC824206XA is fully controlled
86+
using I2C and enables USB data, stereo and mono audio, video,
87+
microphone and UART data to use a common connector port.
88+
7889
config EXTCON_MAX14577
7990
tristate "Maxim MAX14577/77836 EXTCON Support"
8091
depends on MFD_MAX14577

drivers/extcon/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ obj-$(CONFIG_EXTCON_GPIO) += extcon-gpio.o
1212
obj-$(CONFIG_EXTCON_INTEL_INT3496) += extcon-intel-int3496.o
1313
obj-$(CONFIG_EXTCON_INTEL_CHT_WC) += extcon-intel-cht-wc.o
1414
obj-$(CONFIG_EXTCON_INTEL_MRFLD) += extcon-intel-mrfld.o
15+
obj-$(CONFIG_EXTCON_LC824206XA) += extcon-lc824206xa.o
1516
obj-$(CONFIG_EXTCON_MAX14577) += extcon-max14577.o
1617
obj-$(CONFIG_EXTCON_MAX3355) += extcon-max3355.o
1718
obj-$(CONFIG_EXTCON_MAX77693) += extcon-max77693.o

drivers/extcon/extcon-intel-cht-wc.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -461,14 +461,6 @@ static int cht_wc_extcon_psy_get_prop(struct power_supply *psy,
461461
return 0;
462462
}
463463

464-
static const enum power_supply_usb_type cht_wc_extcon_psy_usb_types[] = {
465-
POWER_SUPPLY_USB_TYPE_SDP,
466-
POWER_SUPPLY_USB_TYPE_CDP,
467-
POWER_SUPPLY_USB_TYPE_DCP,
468-
POWER_SUPPLY_USB_TYPE_ACA,
469-
POWER_SUPPLY_USB_TYPE_UNKNOWN,
470-
};
471-
472464
static const enum power_supply_property cht_wc_extcon_psy_props[] = {
473465
POWER_SUPPLY_PROP_USB_TYPE,
474466
POWER_SUPPLY_PROP_ONLINE,
@@ -477,8 +469,11 @@ static const enum power_supply_property cht_wc_extcon_psy_props[] = {
477469
static const struct power_supply_desc cht_wc_extcon_psy_desc = {
478470
.name = "cht_wcove_pwrsrc",
479471
.type = POWER_SUPPLY_TYPE_USB,
480-
.usb_types = cht_wc_extcon_psy_usb_types,
481-
.num_usb_types = ARRAY_SIZE(cht_wc_extcon_psy_usb_types),
472+
.usb_types = BIT(POWER_SUPPLY_USB_TYPE_SDP) |
473+
BIT(POWER_SUPPLY_USB_TYPE_CDP) |
474+
BIT(POWER_SUPPLY_USB_TYPE_DCP) |
475+
BIT(POWER_SUPPLY_USB_TYPE_ACA) |
476+
BIT(POWER_SUPPLY_USB_TYPE_UNKNOWN),
482477
.properties = cht_wc_extcon_psy_props,
483478
.num_properties = ARRAY_SIZE(cht_wc_extcon_psy_props),
484479
.get_property = cht_wc_extcon_psy_get_prop,

0 commit comments

Comments
 (0)