public inbox for linux-phy@lists.infradead.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: "Sebastian Reichel" <sre@kernel.org>,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	"MyungJoo Ham" <myungjoo.ham@samsung.com>,
	"Chanwoo Choi" <cw00.choi@samsung.com>,
	"Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
	"Vinod Koul" <vkoul@kernel.org>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Enric Balletbo Serra" <enric.balletbo@collabora.com>,
	"Andrey Smirnov" <andrew.smirnov@gmail.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, linux-phy@lists.infradead.org
Subject: Re: [PATCH 1/6] power: supply: "usb_type" property may be written to
Date: Tue, 3 Sep 2024 09:04:02 +0200	[thread overview]
Message-ID: <2024090342-succulent-unkempt-666c@gregkh> (raw)
In-Reply-To: <20240831142039.28830-2-hdegoede@redhat.com>

On Sat, Aug 31, 2024 at 04:20:34PM +0200, Hans de Goede wrote:
> According to Documentation/ABI/testing/sysfs-class-power the "usb_type"
> property is Read-Only.
> 
> For power-supplies which consume USB power such as battery charger chips,
> this is correct.
> 
> But the UCS1002 USB Port Power Controller driver which is a driver
> for a chip which is a power-source for USB-A charging ports "usb_type"
> is actually writable to configure the type of USB charger emulated
> by the USB-A port.

Ick, crazy hardware :(

> 
> Adjust the docs and the power_supply_sysfs.c code to adjust for this
> new writeable use of "usb_type":
> 
> 1. Update Documentation/ABI/testing/sysfs-class-power to document that
> "usb_type" may be writable
> 
> 2. Change the power_supply_attr type in power_supply_sysfs.c from
> POWER_SUPPLY_ATTR() into POWER_SUPPLY_ENUM_ATTR() so that the various
> usb_type string values from POWER_SUPPLY_TYPE_TEXT[] such as e.g.
> "SDP" and "USB_PD" can be written to the "usb_type" attribute instead
> of only accepting integer values.
> 
> Cc: Enric Balletbo Serra <enric.balletbo@collabora.com>
> Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  reply	other threads:[~2024-09-03  7:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-31 14:20 [PATCH 0/6] power: supply: Change usb_types from an array into a bitmask Hans de Goede
2024-08-31 14:20 ` [PATCH 1/6] power: supply: "usb_type" property may be written to Hans de Goede
2024-09-03  7:04   ` Greg Kroah-Hartman [this message]
2024-08-31 14:20 ` [PATCH 2/6] power: supply: ucs1002: Adjust ucs1002_set_usb_type() to accept string values Hans de Goede
2024-08-31 14:20 ` [PATCH 3/6] power: supply: rt9467-charger: Remove "usb_type" property write support Hans de Goede
2024-08-31 14:20 ` [PATCH 4/6] power: supply: sysfs: Add power_supply_show_enum_with_available() helper Hans de Goede
2024-08-31 14:20 ` [PATCH 5/6] power: supply: sysfs: Move power_supply_show_enum_with_available() up Hans de Goede
2024-08-31 14:20 ` [PATCH 6/6] power: supply: Change usb_types from an array into a bitmask Hans de Goede
2024-09-03  7:04   ` Greg Kroah-Hartman
2024-09-03  8:27     ` Hans de Goede
2024-09-03  8:32       ` Greg Kroah-Hartman
2024-09-03 21:57 ` [PATCH 0/6] " Sebastian Reichel
2024-09-03 22:04 ` Sebastian Reichel
2024-09-04  9:26   ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2024090342-succulent-unkempt-666c@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=andrew.smirnov@gmail.com \
    --cc=cw00.choi@samsung.com \
    --cc=enric.balletbo@collabora.com \
    --cc=hdegoede@redhat.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=kishon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=myungjoo.ham@samsung.com \
    --cc=sre@kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox