Re: [RFT PATCH 5/9] usb: typec: tipd: Allow to configure irq bits

From: Sven Peter
Date: Wed Sep 22 2021 - 10:58:43 EST


Hi,


On Tue, Sep 21, 2021, at 15:34, Heikki Krogerus wrote:
> On Sat, Sep 18, 2021 at 02:09:30PM +0200, Sven Peter wrote:
>> The Apple variant of the TI TPS6598x chip uses different interrupt
>> numbers. Prepare for that by allowing those to be configured depending
>> on the compatible.
>
> OK, so I think this justifies having a completely separate irq
> handler for your board.

OK, If you're fine with a bit of code duplication for the irq handler this will
all be quite a bit simpler then.

>
>> Signed-off-by: Sven Peter <sven@xxxxxxxxxxxxx>
>> ---
>> drivers/usb/typec/tipd/core.c | 16 ++++++++++++----
>> 1 file changed, 12 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
>> index 4a6d66250fef..d191e7435018 100644
>> --- a/drivers/usb/typec/tipd/core.c
>> +++ b/drivers/usb/typec/tipd/core.c
>> @@ -80,6 +80,10 @@ static const char *const modes[] = {
>> struct tps6598x_hw {
>> bool use_int1;
>> bool use_int2;
>> + unsigned int irq_power_status_update;
>> + unsigned int irq_data_status_update;
>> + unsigned int irq_plug_event;
>> + void (*irq_trace)(u64 event1, u64 event2);
>> };
>
> Then I believe you don't need any of that.

Yup, I think I'll really only need something like

struct tps6598x_hw {
int type;
irq_handler_t irq_handler;
};

in that case!


Thanks,


Sven