/openbmc/linux/drivers/platform/chrome/ |
H A D | cros_ec_typec.c | 1 // SPDX-License-Identifier: GPL-2.0-only 22 #define DRV_NAME "cros-ec-typec" 35 ret = fwnode_property_read_string(fwnode, "power-role", &buf); in cros_typec_parse_port_props() 37 dev_err(dev, "power-role not found: %d\n", ret); in cros_typec_parse_port_props() 44 cap->type = ret; in cros_typec_parse_port_props() 46 ret = fwnode_property_read_string(fwnode, "data-role", &buf); in cros_typec_parse_port_props() 48 dev_err(dev, "data-role not found: %d\n", ret); in cros_typec_parse_port_props() 55 cap->data = ret; in cros_typec_parse_port_props() 57 /* Try-power-role is optional. */ in cros_typec_parse_port_props() 58 ret = fwnode_property_read_string(fwnode, "try-power-role", &buf); in cros_typec_parse_port_props() [all …]
|
H A D | cros_ec_typec.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 11 #include <linux/usb/typec.h> 30 /* Platform-specific data for the Chrome OS EC Type C controller. */ 59 struct typec_mux *mux; member 77 /* PDO-related structs */
|
H A D | cros_typec_switch.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * This driver provides the ability to configure Type-C muxes and retimers which are controlled by 29 /* Driver-specific data. */ 48 return cros_ec_cmd(sdata->ec, 0, EC_CMD_TYPEC_CONTROL, &req, sizeof(req), NULL, 0); in cros_typec_cmd_mux_set() 53 int ret = -EOPNOTSUPP; in cros_typec_get_mux_state() 60 } else if (alt && alt->svid == USB_TYPEC_DP_SID) { in cros_typec_get_mux_state() 62 pin_assign = mode - TYPEC_STATE_MODAL; in cros_typec_get_mux_state() 79 return cros_ec_cmd(sdata->ec, 0, EC_CMD_TYPEC_CONTROL, &req, sizeof(req), NULL, 0); in cros_typec_send_clear_event() 90 ret = cros_ec_cmd(sdata->ec, 0, EC_CMD_TYPEC_STATUS, &req, sizeof(req), in cros_typec_check_event() 93 dev_warn(sdata->dev, "EC_CMD_TYPEC_STATUS failed for port: %d\n", port_num); in cros_typec_check_event() [all …]
|
/openbmc/linux/Documentation/driver-api/usb/ |
H A D | typec.rst | 3 USB Type-C connector class 7 ------------ 9 The typec class is meant for describing the USB Type-C ports in a system to the 14 The platforms are expected to register every USB Type-C port they have with the 15 class. In a normal case the registration will be done by a USB Type-C or PD PHY 18 considers the component registering the USB Type-C ports with the class as "port 26 attributes are described in Documentation/ABI/testing/sysfs-class-typec. 29 -------------------- 30 Every port will be presented as its own device under /sys/class/typec/. The 34 /sys/class/typec/. The parent of the partner device will always be the port it [all …]
|
H A D | typec_bus.rst | 2 API for USB Type-C Alternate Mode drivers 6 ------------ 9 Messages (VDM) as defined in USB Type-C and USB Power Delivery Specifications. 13 USB Type-C bus allows binding a driver to the discovered partner alternate 16 :ref:`USB Type-C Connector Class <typec>` provides a device for every alternate 36 ------ 43 space (See Documentation/ABI/testing/sysfs-class-typec). Port drivers should not 46 ``->vdm`` is the most important callback in the operation callbacks vector. It 55 parameter. The bus driver will then configure the mux behind the connector using 56 that value as the state value for the mux. [all …]
|
/openbmc/linux/drivers/usb/typec/ |
H A D | Makefile | 1 # SPDX-License-Identifier: GPL-2.0 2 obj-$(CONFIG_TYPEC) += typec.o 3 typec-y := class.o mux.o bus.o pd.o retimer.o 4 typec-$(CONFIG_ACPI) += port-mapper.o 5 obj-$(CONFIG_TYPEC) += altmodes/ 6 obj-$(CONFIG_TYPEC_TCPM) += tcpm/ 7 obj-$(CONFIG_TYPEC_UCSI) += ucsi/ 8 obj-$(CONFIG_TYPEC_TPS6598X) += tipd/ 9 obj-$(CONFIG_TYPEC_ANX7411) += anx7411.o 10 obj-$(CONFIG_TYPEC_HD3SS3220) += hd3ss3220.o [all …]
|
H A D | Kconfig | 1 # SPDX-License-Identifier: GPL-2.0 3 menuconfig TYPEC config 4 tristate "USB Type-C Support" 6 USB Type-C Specification defines a cable and connector for USB where 8 be Type-A plug on one end of the cable and Type-B plug on the other. 9 Determination of the host-to-device relationship happens through a 10 specific Configuration Channel (CC) which goes through the USB Type-C 12 Accessory Modes - Analog Audio and Debug - and if USB Power Delivery 22 USB Type-C connector, however it is mostly used together with USB 23 Type-C connectors. [all …]
|
H A D | anx7411.c | 1 // SPDX-License-Identifier: GPL-2.0-only 4 * Driver for Analogix ANX7411 USB Type-C and PD controller 25 #include <linux/usb/typec.h> 222 /* copy from drivers/usb/typec/tcpm */ 280 struct typec_params typec; member 340 ret = anx7411_reg_read(ctx->spi_client, REQUEST_CURRENT); in anx7411_detect_power_mode() 344 ctx->typec.request_current = ret * CURRENT_UNIT; /* 50ma per unit */ in anx7411_detect_power_mode() 346 ret = anx7411_reg_read(ctx->spi_client, REQUEST_VOLTAGE); in anx7411_detect_power_mode() 350 ctx->typec.request_voltage = ret * VOLTAGE_UNIT; /* 100mv per unit */ in anx7411_detect_power_mode() 352 if (ctx->psy_online == ANX7411_PSY_OFFLINE) { in anx7411_detect_power_mode() [all …]
|
H A D | mux.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * USB Type-C Multiplexer/DeMultiplexer Switch support 18 #include "mux.h" 44 * an additional device property is needed. With typec switches the in typec_switch_match() 45 * property is named "orientation-switch" (@id). The value of the device in typec_switch_match() 52 * At this point we are sure that @fwnode is a typec switch in all in typec_switch_match() 59 return dev ? to_typec_switch_dev(dev) : ERR_PTR(-EPROBE_DEFER); in typec_switch_match() 63 * fwnode_typec_switch_get - Find USB Type-C orientation switch 68 * ERR_PTR(-EPROBE_DEFER) when a connection was found but the switch 81 return ERR_PTR(-ENOMEM); in fwnode_typec_switch_get() [all …]
|
H A D | bus.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Bus for USB Type-C Alternate Modes 13 #include "mux.h" 21 if (!alt->retimer) in typec_altmode_set_retimer() 24 state.alt = &alt->adev; in typec_altmode_set_retimer() 28 return typec_retimer_set(alt->retimer, &state); in typec_altmode_set_retimer() 36 if (!alt->mux) in typec_altmode_set_mux() 39 state.alt = &alt->adev; in typec_altmode_set_mux() 43 return typec_mux_set(alt->mux, &state); in typec_altmode_set_mux() 46 /* Wrapper to set various Type-C port switches together. */ [all …]
|
H A D | class.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 7 #include <linux/usb/typec.h> 57 struct typec_mux *mux; member 74 #define is_typec_partner(dev) ((dev)->type == &typec_partner_dev_type) 75 #define is_typec_cable(dev) ((dev)->type == &typec_cable_dev_type) 76 #define is_typec_plug(dev) ((dev)->type == &typec_plug_dev_type) 77 #define is_typec_port(dev) ((dev)->type == &typec_port_dev_type)
|
/openbmc/linux/drivers/usb/typec/mux/ |
H A D | gpio-sbu-mux.c | 1 // SPDX-License-Identifier: GPL-2.0 19 struct typec_mux_dev *mux; member 33 mutex_lock(&sbu_mux->lock); in gpio_sbu_switch_set() 35 enabled = sbu_mux->enabled; in gpio_sbu_switch_set() 36 swapped = sbu_mux->swapped; in gpio_sbu_switch_set() 50 if (enabled != sbu_mux->enabled) in gpio_sbu_switch_set() 51 gpiod_set_value(sbu_mux->enable_gpio, enabled); in gpio_sbu_switch_set() 53 if (swapped != sbu_mux->swapped) in gpio_sbu_switch_set() 54 gpiod_set_value(sbu_mux->select_gpio, swapped); in gpio_sbu_switch_set() 56 sbu_mux->enabled = enabled; in gpio_sbu_switch_set() [all …]
|
H A D | pi3usb30532.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * Pericom PI3USB30532 Type-C cross switch / mux driver 5 * Copyright (c) 2017-2018 Hans de Goede <hdegoede@redhat.com> 27 struct typec_mux_dev *mux; member 35 if (pi->conf == new_conf) in pi3usb30532_set_conf() 38 ret = i2c_smbus_write_byte_data(pi->client, PI3USB30532_CONF, new_conf); in pi3usb30532_set_conf() 40 dev_err(&pi->client->dev, "Error writing conf: %d\n", ret); in pi3usb30532_set_conf() 44 pi->conf = new_conf; in pi3usb30532_set_conf() 55 mutex_lock(&pi->lock); in pi3usb30532_sw_set() 56 new_conf = pi->conf; in pi3usb30532_sw_set() [all …]
|
H A D | fsa4480.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Copyright (C) 2021-2022 Linaro Ltd. 4 * Copyright (C) 2018-2020 The Linux Foundation 54 struct typec_mux_dev *mux; member 69 /* Accesses only done under fsa4480->lock */ 75 bool reverse = (fsa->orientation == TYPEC_ORIENTATION_REVERSE); in fsa4480_set() 80 if (fsa->mode < TYPEC_STATE_MODAL || in fsa4480_set() 81 (!fsa->svid && (fsa->mode == TYPEC_MODE_USB2 || in fsa4480_set() 82 fsa->mode == TYPEC_MODE_USB3))) { in fsa4480_set() 85 } else if (fsa->svid) { in fsa4480_set() [all …]
|
/openbmc/linux/Documentation/devicetree/bindings/connector/ |
H A D | usb-connector.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only 3 --- 4 $id: http://devicetree.org/schemas/connector/usb-connector.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 - Rob Herring <robh@kernel.org> 15 MUX and USB interface controller. 20 - enum: 21 - usb-a-connector 22 - usb-b-connector 23 - usb-c-connector [all …]
|
/openbmc/linux/Documentation/devicetree/bindings/usb/ |
H A D | fcs,fsa4480.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 3 --- 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 - Bjorn Andersson <bjorn.andersson@linaro.org> 15 - fcs,fsa4480 23 vcc-supply: 24 description: power supply (2.7V-5.5V) 26 mode-switch: 30 orientation-switch: 37 A port node to link the FSA4480 to a TypeC controller for the purpose of [all …]
|
H A D | gpio-sbu-mux.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 3 --- 4 $id: http://devicetree.org/schemas/usb/gpio-sbu-mux.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: GPIO-based SBU mux 10 - Bjorn Andersson <andersson@kernel.org> 13 In USB Type-C applications the SBU lines needs to be connected, disconnected 21 - enum: 22 - onnn,fsusb43l10x 23 - pericom,pi3usb102 [all …]
|
H A D | ti,hd3ss3220.yaml | 1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 3 --- 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: TI HD3SS3220 TypeC DRP Port Controller 10 - Biju Das <biju.das.jz@bp.renesas.com> 12 description: |- 13 HD3SS3220 is a USB SuperSpeed (SS) 2:1 mux with DRP port controller. The device provides Channel 14 Configuration (CC) logic and 5V VCONN sourcing for ecosystems implementing USB Type-C. The 36 description: Super Speed (SS) MUX inputs connected to SS capable connector. 40 description: Output of 2:1 MUX connected to Super Speed (SS) data bus. [all …]
|
H A D | onnn,nb7vpq904m.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 3 --- 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: ON Semiconductor Type-C DisplayPort ALT Mode Linear Redriver 10 - Neil Armstrong <neil.armstrong@linaro.org> 15 - onnn,nb7vpq904m 20 vcc-supply: 23 enable-gpios: true 25 retimer-switch: 29 orientation-switch: [all …]
|
/openbmc/linux/include/linux/usb/ |
H A D | typec_mux.h | 1 // SPDX-License-Identifier: GPL-2.0 7 #include <linux/usb/typec.h> 51 typedef int (*typec_mux_set_fn_t)(struct typec_mux_dev *mux, 64 void typec_mux_put(struct typec_mux *mux); 65 int typec_mux_set(struct typec_mux *mux, struct typec_mux_state *state); 69 void typec_mux_unregister(struct typec_mux_dev *mux); 71 void typec_mux_set_drvdata(struct typec_mux_dev *mux, void *data); 72 void *typec_mux_get_drvdata(struct typec_mux_dev *mux); 81 static inline void typec_mux_put(struct typec_mux *mux) {} in typec_mux_put() argument 83 static inline int typec_mux_set(struct typec_mux *mux, struct typec_mux_state *state) in typec_mux_set() argument [all …]
|
H A D | typec_altmode.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 7 #include <linux/usb/typec.h> 15 * struct typec_altmode - USB Type-C alternate mode device 40 dev_set_drvdata(&altmode->dev, data); in typec_altmode_set_drvdata() 45 return dev_get_drvdata(&altmode->dev); in typec_altmode_get_drvdata() 49 * struct typec_altmode_ops - Alternate mode specific operations vector 79 * These are the connector states (USB, Safe and Alt Mode) defined in USB Type-C 92 * here. Unlike with Alternate Modes, where the mux will be linked with the 93 * alternate mode device, the mux for Accessory Modes will be linked with the 126 * typec_altmode_get_orientation - Get cable plug orientation [all …]
|
/openbmc/linux/drivers/phy/ti/ |
H A D | phy-j721e-wiz.c | 1 // SPDX-License-Identifier: GPL-2.0 5 * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/ 9 #include <dt-bindings/phy/phy.h> 10 #include <dt-bindings/phy/phy-ti.h> 13 #include <linux/clk-provider.h> 19 #include <linux/mux/consumer.h> 25 #include <linux/reset-controller.h> 44 /* To include mux clocks, divider clocks and gate clocks */ 125 [TI_WIZ_PLL0_REFCLK] = "pll0-refclk", 126 [TI_WIZ_PLL1_REFCLK] = "pll1-refclk", [all …]
|
/openbmc/linux/Documentation/firmware-guide/acpi/ |
H A D | intel-pmc-mux.rst | 1 .. SPDX-License-Identifier: GPL-2.0 4 Intel North Mux-Agent 10 North Mux-Agent is a function of the Intel PMC firmware that is supported on 13 platforms that allow the mux-agent to be configured from the operating system 16 The North Mux-Agent (aka. Intel PMC Mux Control, or just mux-agent) driver 18 (drivers/platform/x86/intel_scu_ipc.c). The driver registers with the USB Type-C 19 Mux Class which allows the USB Type-C Controller and Interface drivers to 22 Device modes. The driver is located here: drivers/usb/typec/mux/intel_pmc_mux.c. 28 ------- 30 For every USB Type-C connector under the mux-agent control on the system, there [all …]
|
/openbmc/linux/Documentation/devicetree/bindings/phy/ |
H A D | ti,phy-j721e-wiz.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 # Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/ 4 --- 5 $id: http://devicetree.org/schemas/phy/ti,phy-j721e-wiz.yaml# 6 $schema: http://devicetree.org/meta-schemas/core.yaml# 11 - Kishon Vijay Abraham I <kishon@ti.com> 16 - ti,j721e-wiz-16g 17 - ti,j721e-wiz-10g 18 - ti,j721s2-wiz-10g 19 - ti,am64-wiz-10g [all …]
|
/openbmc/linux/arch/arm64/boot/dts/freescale/ |
H A D | imx8mp-beacon-kit.dts | 1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 6 /dts-v1/; 8 #include <dt-bindings/usb/pd.h> 9 #include <dt-bindings/phy/phy-imx8-pcie.h> 11 #include "imx8mp-beacon-som.dtsi" 15 compatible = "beacon,imx8mp-beacon-kit", "fsl,imx8mp"; 23 stdout-path = &uart2; 27 compatible = "usb-c-connector"; 28 label = "USB-C"; 29 data-role = "dual"; [all …]
|