[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <d8024591-0142-442e-98e9-0c92a7679768@www.fastmail.com>
Date: Wed, 22 Sep 2021 17:00:31 +0200
From: "Sven Peter" <sven@...npeter.dev>
To: "Heikki Krogerus" <heikki.krogerus@...ux.intel.com>
Cc: "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
Guido Günther <agx@...xcpu.org>,
"Bryan O'Donoghue" <bryan.odonoghue@...aro.org>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
"Hector Martin" <marcan@...can.st>,
"Mohamed Mediouni" <mohamed.mediouni@...amail.com>,
"Stan Skowronek" <stan@...ellium.com>,
"Mark Kettenis" <mark.kettenis@...all.nl>,
"Alexander Graf" <graf@...zon.com>,
"Alyssa Rosenzweig" <alyssa@...enzweig.io>
Subject: Re: [RFT PATCH 8/9] usb: typec: tipd: Switch power state to S0 for Apple variant
On Tue, Sep 21, 2021, at 15:46, Heikki Krogerus wrote:
> On Sat, Sep 18, 2021 at 02:09:33PM +0200, Sven Peter wrote:
>> The Apple CD321x comes up in a low-power state after boot. Usually, the
>> bootloader will already power it up to S0 but let's do it here as well
>> in case that didn't happen.
>>
>> Suggested-by: Stan Skowronek <stan@...ellium.com>
>> Signed-off-by: Sven Peter <sven@...npeter.dev>
>> ---
>> drivers/usb/typec/tipd/core.c | 44 +++++++++++++++++++++++++++++++
>> drivers/usb/typec/tipd/tps6598x.h | 6 +++++
>> 2 files changed, 50 insertions(+)
>>
>> diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
>> index e96b17fe6af6..26807c050662 100644
>> --- a/drivers/usb/typec/tipd/core.c
>> +++ b/drivers/usb/typec/tipd/core.c
>> @@ -30,6 +30,7 @@
>> #define TPS_REG_INT_MASK2 0x17
>> #define TPS_REG_INT_CLEAR1 0x18
>> #define TPS_REG_INT_CLEAR2 0x19
>> +#define TPS_REG_SYSTEM_POWER_STATE 0x20
>> #define TPS_REG_STATUS 0x1a
>> #define TPS_REG_SYSTEM_CONF 0x28
>> #define TPS_REG_CTRL_CONF 0x29
>> @@ -84,6 +85,8 @@ struct tps6598x_hw {
>> unsigned int irq_data_status_update;
>> unsigned int irq_plug_event;
>> void (*irq_trace)(u64 event1, u64 event2);
>> +
>> + bool supports_spss;
>> };
[...]
>> static int devm_tps6598_psy_register(struct tps6598x *tps)
>> {
>> struct power_supply_config psy_cfg = {};
>> @@ -648,6 +685,11 @@ static int tps6598x_probe(struct i2c_client *client)
>> if (ret)
>> return ret;
>>
>> + /* Switch Apple chips to the correct system power state */
>> + ret = cd321x_switch_power_state(tps, TPS_SYSTEM_POWER_STATE_S0);
>> + if (ret)
>> + return ret;
>
> If you call this from the same quirk where you set the mask for your
> board, you don't need that supports_spss flag at all, right?
Yup, that one will also disappear then.
Thanks,
Sven
Powered by blists - more mailing lists