* [PATCH] usb: usb251xb: Set boost value for up- and downstream ports
[not found] <PH0PR17MB48487D4BC9BB0D3C38D8EED38E0C9@PH0PR17MB4848.namprd17.prod.outlook.com>
@ 2022-03-11 10:04 ` Neumann, Bastian
2022-03-11 10:37 ` Krzysztof Kozlowski
0 siblings, 1 reply; 2+ messages in thread
From: Neumann, Bastian @ 2022-03-11 10:04 UTC (permalink / raw)
To: linux-usb@vger.kernel.org; +Cc: devicetree@vger.kernel.org
This patch adds devicetree properties to enable signal boosting on USB ports.
Signed-off-by: Bastian Neumann <bastian.neumann@dentsplysirona.com>
---
.../devicetree/bindings/usb/usb251xb.txt | 22 +++++++++++++
drivers/usb/misc/usb251xb.c | 32 +++++++++++++++++--
2 files changed, 52 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/usb/usb251xb.txt b/Documentation/devicetree/bindings/usb/usb251xb.txt
index 1a934eab175e..538ae49fc31d 100644
--- a/Documentation/devicetree/bindings/usb/usb251xb.txt
+++ b/Documentation/devicetree/bindings/usb/usb251xb.txt
@@ -68,6 +68,26 @@ Optional properties :
- swap-dx-lanes : Specifies the ports which will swap the differential-pair
(D+/D-), default is not-swapped.
+Electrical signal boosting
+The controller supplies a "boosting" functionality to drive up the USB
+electrical signals. This could result in non-USB compliant parameters
+(one example would be J/K level test). This should be <0x00> unless
+specific implementation issues requiew additional signal boosting to
+correct for deraded USB signaling levels:
+ - <0x00> : Normal electrical drive strength (no boost)
+ - <0x01> : Elevated drive strength low (~4% boost)
+ - <0x02> : Elevated drive strength medium (~8% boost)
+ - <0x03> : Elevated drive strength high (~12% boost)
+
+ - boost-up : USB electrical signaling drive strength boost for upstream port.
+ - boost-1 : USB electrical signaling drive strength boost for port 1.
+ - boost-2 : USB electrical signaling drive strength boost for port 2.
+ - boost-3 : USB electrical signaling drive strength boost for port 3.
+ - boost-4 : USB electrical signaling drive strength boost for port 4.
+ - boost-5 : USB electrical signaling drive strength boost for port 5.
+ - boost-6 : USB electrical signaling drive strength boost for port 6.
+ - boost-7 : USB electrical signaling drive strength boost for port 7.
+
Examples:
usb2512b@2c {
compatible = "microchip,usb2512b";
@@ -86,4 +106,6 @@ Examples:
serial = "1234567890A";
/* correct misplaced usb connectors on port 1,2 */
swap-dx-lanes = <1 2>;
+ boost-up = <0x00>; /* no boost for upstream port */
+ boost-1 = <0x02>; /* medium boost on port 1 */
};
diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 04c4e3fed094..625106343d12 100644
--- a/drivers/usb/misc/usb251xb.c
+++ b/drivers/usb/misc/usb251xb.c
@@ -575,6 +575,36 @@ static int usb251xb_get_ofdata(struct usb251xb *hub,
(wchar_t *)hub->serial,
USB251XB_STRING_BUFSIZE);
+ hub->boost_up = USB251XB_DEF_BOOST_UP;
+ if (!of_property_read_u32(np, "boost-up",
+ &property_u32))
+ hub->boost_up |= (property_u32 << 0);
+
+ hub->boost_14 = USB251XB_DEF_BOOST_14;
+ if (!of_property_read_u32(np, "boost-1",
+ &property_u32))
+ hub->boost_14 |= (property_u32 << 0);
+ if (!of_property_read_u32(np, "boost-2",
+ &property_u32))
+ hub->boost_14 |= (property_u32 << 2);
+ if (!of_property_read_u32(np, "boost-3",
+ &property_u32))
+ hub->boost_14 |= (property_u32 << 4);
+ if (!of_property_read_u32(np, "boost-4",
+ &property_u32))
+ hub->boost_14 |= (property_u32 << 6);
+ hub->boost_57 = USB251XB_DEF_BOOST_57;
+ if (!of_property_read_u32(np, "boost-5",
+ &property_u32))
+ hub->boost_57 |= (property_u32 << 0);
+ if (!of_property_read_u32(np, "boost-6",
+ &property_u32))
+ hub->boost_57 |= (property_u32 << 2);
+ if (!of_property_read_u32(np, "boost-7",
+ &property_u32))
+ hub->boost_57 |= (property_u32 << 4);
+
+
/*
* The datasheet documents the register as 'Port Swap' but in real the
* register controls the USB DP/DM signal swapping for each port.
@@ -587,8 +617,6 @@ static int usb251xb_get_ofdata(struct usb251xb *hub,
* may be as soon as needed.
*/
hub->bat_charge_en = USB251XB_DEF_BATTERY_CHARGING_ENABLE;
- hub->boost_57 = USB251XB_DEF_BOOST_57;
- hub->boost_14 = USB251XB_DEF_BOOST_14;
hub->port_map12 = USB251XB_DEF_PORT_MAP_12;
hub->port_map34 = USB251XB_DEF_PORT_MAP_34;
hub->port_map56 = USB251XB_DEF_PORT_MAP_56;
--
2.30.2
-----------------------------------------------------------------------------------------------------------
Sirona Dental Systems GmbH
Sitz der Gesellschaft / registered address: Fabrikstraße 31, 64625 Bensheim
Registergericht / court of registry: Amtsgericht Darmstadt, HRB 24948
Geschäftsführer / Managing Director: Dr. Cord Stähler, Jan Siefert, Rainer Raschke
Aufsichtsratsvorsitzender / Chairman of the Supervisory Board: Dr. Alexander Voelcker
-----------------------------------------------------------------------------------------------------------
Diese E-Mail ist ausschliesslich fuer den angesprochenen Adressaten
bestimmt und kann vertrauliche Informationen beinhalten.
--
This e-mail is intended only for the designated recipient(s). It may
contain confidential or proprietary information.
------------------------------------------------------------------------------------------------------------
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] usb: usb251xb: Set boost value for up- and downstream ports
2022-03-11 10:04 ` [PATCH] usb: usb251xb: Set boost value for up- and downstream ports Neumann, Bastian
@ 2022-03-11 10:37 ` Krzysztof Kozlowski
0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2022-03-11 10:37 UTC (permalink / raw)
To: Neumann, Bastian, linux-usb@vger.kernel.org; +Cc: devicetree@vger.kernel.org
On 11/03/2022 11:04, Neumann, Bastian wrote:
> This patch adds devicetree properties to enable signal boosting on USB ports.
>
> Signed-off-by: Bastian Neumann <bastian.neumann@dentsplysirona.com>
> ---
> .../devicetree/bindings/usb/usb251xb.txt | 22 +++++++++++++
Please split the bindings change. scripts/checkpatch did not complain?
You also need to Cc maintainers. Use scripts/get_maintainer.pl for this.
Read:
https://elixir.bootlin.com/linux/v5.13/source/Documentation/process/submitting-patches.rst
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-11 10:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <PH0PR17MB48487D4BC9BB0D3C38D8EED38E0C9@PH0PR17MB4848.namprd17.prod.outlook.com>
2022-03-11 10:04 ` [PATCH] usb: usb251xb: Set boost value for up- and downstream ports Neumann, Bastian
2022-03-11 10:37 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).