Skip to content

Commit 5ab1a04

Browse files
committed
Merge tag 'extcon-next-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next
Chanwoo writes: Update extcon next for v6.7 Detailed description for this pull request: - Add new Realtek DHC(Digital Home Hub) RTD SoC external connector driver : Detect USB Type C cable detection for USB and USB_HOST cable and support USB Type-C connector class. The extcon-rtk-type-c.c driver supports the following Realtek RTD SoC: - realtek,rtd1295-type-c - realtek,rtd1312c-type-c - realtek,rtd1315e-type-c - realtek,rtd1319-type-c - realtek,rtd1319d-type-c - realtek,rtd1395-type-c - realtek,rtd1619-type-c - realtek,rtd1619b-type-c - Add device-tree compatible string for extcon-max77693 and extcon-77843.c. * tag 'extcon-next-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon: extcon: realtek: add the error handler for nvmem_cell_read extcon: max77843: add device-tree compatible string extcon: max77693: add device-tree compatible string dt-bindings: usb: Add Realtek DHC RTD SoC Type-C extcon: add Realtek DHC RTD SoC Type-C driver
2 parents 800dce4 + b3edc34 commit 5ab1a04

6 files changed

Lines changed: 1902 additions & 0 deletions

File tree

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
# Copyright 2023 Realtek Semiconductor Corporation
3+
%YAML 1.2
4+
---
5+
$id: http://devicetree.org/schemas/usb/realtek,rtd-type-c.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: Realtek DHC RTD SoCs USB Type-C Connector detection
9+
10+
maintainers:
11+
- Stanley Chang <stanley_chang@realtek.com>
12+
13+
description:
14+
Realtek digital home center (DHC) RTD series SoCs include a type c module.
15+
This module is able to detect the state of type c connector.
16+
17+
properties:
18+
compatible:
19+
enum:
20+
- realtek,rtd1295-type-c
21+
- realtek,rtd1312c-type-c
22+
- realtek,rtd1315e-type-c
23+
- realtek,rtd1319-type-c
24+
- realtek,rtd1319d-type-c
25+
- realtek,rtd1395-type-c
26+
- realtek,rtd1619-type-c
27+
- realtek,rtd1619b-type-c
28+
29+
reg:
30+
maxItems: 1
31+
32+
interrupts:
33+
maxItems: 1
34+
35+
nvmem-cell-names:
36+
items:
37+
- const: usb-cal
38+
39+
nvmem-cells:
40+
maxItems: 1
41+
description:
42+
The phandle to nvmem cell that contains the trimming data.
43+
The type c parameter trimming data specified via efuse.
44+
If unspecified, default value is used.
45+
46+
realtek,rd-ctrl-gpios:
47+
description: The gpio node to control external Rd on board.
48+
maxItems: 1
49+
50+
connector:
51+
$ref: /schemas/connector/usb-connector.yaml#
52+
description: Properties for usb c connector.
53+
type: object
54+
55+
required:
56+
- compatible
57+
- reg
58+
- interrupts
59+
60+
additionalProperties: false
61+
62+
examples:
63+
- |
64+
#include <dt-bindings/interrupt-controller/irq.h>
65+
66+
type-c@7220 {
67+
compatible = "realtek,rtd1619b-type-c";
68+
reg = <0x7220 0x20>;
69+
interrupts = <0 60 IRQ_TYPE_LEVEL_HIGH>;
70+
71+
pinctrl-names = "default";
72+
pinctrl-0 = <&usb_cc1_pins>, <&usb_cc2_pins>;
73+
nvmem-cells = <&otp_usb_cal>;
74+
nvmem-cell-names = "usb-cal";
75+
76+
connector {
77+
compatible = "usb-c-connector";
78+
label = "USB-C";
79+
data-role = "dual";
80+
power-role = "dual";
81+
};
82+
};

drivers/extcon/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,15 @@ config EXTCON_USBC_TUSB320
191191
Say Y here to enable support for USB Type C cable detection extcon
192192
support using a TUSB320.
193193

194+
config EXTCON_RTK_TYPE_C
195+
tristate "Realtek RTD SoC extcon Type-C Driver"
196+
depends on ARCH_REALTEK || COMPILE_TEST
197+
depends on TYPEC
198+
select USB_COMMON
199+
help
200+
Say Y here to enable extcon support for USB Type C cable detection
201+
when using the Realtek RTD SoC USB Type-C port.
202+
The DHC (Digital Home Hub) RTD series SoC contains a type c module.
203+
This driver will detect the status of the type-c port.
204+
194205
endif

drivers/extcon/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ obj-$(CONFIG_EXTCON_SM5502) += extcon-sm5502.o
2525
obj-$(CONFIG_EXTCON_USB_GPIO) += extcon-usb-gpio.o
2626
obj-$(CONFIG_EXTCON_USBC_CROS_EC) += extcon-usbc-cros-ec.o
2727
obj-$(CONFIG_EXTCON_USBC_TUSB320) += extcon-usbc-tusb320.o
28+
obj-$(CONFIG_EXTCON_RTK_TYPE_C) += extcon-rtk-type-c.o

drivers/extcon/extcon-max77693.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,9 +1258,16 @@ static int max77693_muic_probe(struct platform_device *pdev)
12581258
return ret;
12591259
}
12601260

1261+
static const struct of_device_id of_max77693_muic_dt_match[] = {
1262+
{ .compatible = "maxim,max77693-muic", },
1263+
{ /* sentinel */ },
1264+
};
1265+
MODULE_DEVICE_TABLE(of, of_max77693_muic_dt_match);
1266+
12611267
static struct platform_driver max77693_muic_driver = {
12621268
.driver = {
12631269
.name = DEV_NAME,
1270+
.of_match_table = of_max77693_muic_dt_match,
12641271
},
12651272
.probe = max77693_muic_probe,
12661273
};

drivers/extcon/extcon-max77843.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,9 +946,16 @@ static const struct platform_device_id max77843_muic_id[] = {
946946
};
947947
MODULE_DEVICE_TABLE(platform, max77843_muic_id);
948948

949+
static const struct of_device_id of_max77843_muic_dt_match[] = {
950+
{ .compatible = "maxim,max77843-muic", },
951+
{ /* sentinel */ },
952+
};
953+
MODULE_DEVICE_TABLE(of, of_max77843_muic_dt_match);
954+
949955
static struct platform_driver max77843_muic_driver = {
950956
.driver = {
951957
.name = "max77843-muic",
958+
.of_match_table = of_max77843_muic_dt_match,
952959
},
953960
.probe = max77843_muic_probe,
954961
.remove = max77843_muic_remove,

0 commit comments

Comments
 (0)