* usb: typec: altmodes/displayport: Fall back to multi-func pins
@ 2019-02-25 15:49 Heikki Krogerus
0 siblings, 0 replies; 5+ messages in thread
From: Heikki Krogerus @ 2019-02-25 15:49 UTC (permalink / raw)
To: Hans de Goede; +Cc: Greg Kroah-Hartman, linux-usb
On Mon, Feb 25, 2019 at 01:56:37PM +0100, Hans de Goede wrote:
> If our port-partner supports both DP-only operation (pin-assignment C)
> and multi-func operation (pin-assignment D) and we only support
> pin-assignment D and the port-partner prefers DP-only mode, then
> before this commit we would and up masking out pin-assignment D from
> the available pin-assignments and fail to pick a pin-assignment.
>
> Instead only mask out the multi-func pin-assignments if we support
> dp-only pin-assignments, so that we correctly fall-back to a multi-func
> pin-assignment in this case (by picking pin-assignment D).
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Should this be handled as a fix?
> ---
> drivers/usb/typec/altmodes/displayport.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c
> index 3f06e94771a7..35161594e368 100644
> --- a/drivers/usb/typec/altmodes/displayport.c
> +++ b/drivers/usb/typec/altmodes/displayport.c
> @@ -104,7 +104,7 @@ static int dp_altmode_configure(struct dp_altmode *dp, u8 con)
> if (dp->data.status & DP_STATUS_PREFER_MULTI_FUNC &&
> pin_assign & DP_PIN_ASSIGN_MULTI_FUNC_MASK)
> pin_assign &= DP_PIN_ASSIGN_MULTI_FUNC_MASK;
> - else
> + else if (pin_assign & DP_PIN_ASSIGN_DP_ONLY_MASK)
> pin_assign &= DP_PIN_ASSIGN_DP_ONLY_MASK;
>
> if (!pin_assign)
> --
> 2.20.1
thanks,
^ permalink raw reply [flat|nested] 5+ messages in thread
* usb: typec: altmodes/displayport: Fall back to multi-func pins
@ 2019-03-15 14:37 Heikki Krogerus
0 siblings, 0 replies; 5+ messages in thread
From: Heikki Krogerus @ 2019-03-15 14:37 UTC (permalink / raw)
To: Hans de Goede; +Cc: Greg Kroah-Hartman, linux-usb
On Mon, Feb 25, 2019 at 01:56:37PM +0100, Hans de Goede wrote:
> If our port-partner supports both DP-only operation (pin-assignment C)
> and multi-func operation (pin-assignment D) and we only support
> pin-assignment D and the port-partner prefers DP-only mode, then
> before this commit we would and up masking out pin-assignment D from
> the available pin-assignments and fail to pick a pin-assignment.
>
> Instead only mask out the multi-func pin-assignments if we support
> dp-only pin-assignments, so that we correctly fall-back to a multi-func
> pin-assignment in this case (by picking pin-assignment D).
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/altmodes/displayport.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c
> index 3f06e94771a7..35161594e368 100644
> --- a/drivers/usb/typec/altmodes/displayport.c
> +++ b/drivers/usb/typec/altmodes/displayport.c
> @@ -104,7 +104,7 @@ static int dp_altmode_configure(struct dp_altmode *dp, u8 con)
> if (dp->data.status & DP_STATUS_PREFER_MULTI_FUNC &&
> pin_assign & DP_PIN_ASSIGN_MULTI_FUNC_MASK)
> pin_assign &= DP_PIN_ASSIGN_MULTI_FUNC_MASK;
> - else
> + else if (pin_assign & DP_PIN_ASSIGN_DP_ONLY_MASK)
> pin_assign &= DP_PIN_ASSIGN_DP_ONLY_MASK;
>
> if (!pin_assign)
> --
> 2.20.1
thanks,
^ permalink raw reply [flat|nested] 5+ messages in thread
* usb: typec: altmodes/displayport: Fall back to multi-func pins
@ 2019-02-27 8:50 Heikki Krogerus
0 siblings, 0 replies; 5+ messages in thread
From: Heikki Krogerus @ 2019-02-27 8:50 UTC (permalink / raw)
To: Hans de Goede; +Cc: Greg Kroah-Hartman, linux-usb
On Mon, Feb 25, 2019 at 07:50:32PM +0100, Hans de Goede wrote:
> Hi Heikki,
>
> On 25-02-19 16:49, Heikki Krogerus wrote:
> > On Mon, Feb 25, 2019 at 01:56:37PM +0100, Hans de Goede wrote:
> > > If our port-partner supports both DP-only operation (pin-assignment C)
> > > and multi-func operation (pin-assignment D) and we only support
> > > pin-assignment D and the port-partner prefers DP-only mode, then
> > > before this commit we would and up masking out pin-assignment D from
> > > the available pin-assignments and fail to pick a pin-assignment.
> > >
> > > Instead only mask out the multi-func pin-assignments if we support
> > > dp-only pin-assignments, so that we correctly fall-back to a multi-func
> > > pin-assignment in this case (by picking pin-assignment D).
> > >
> > > Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> >
> > Should this be handled as a fix?
>
> AFAIK they are no users if this yet, until we've agreement
> on the DT bindings and code merged for adding alt-modes
> to an usb-connector node, nothing will be using this code,
> so I see little use in adding a Cc: stable or some such.
True.
thanks,
^ permalink raw reply [flat|nested] 5+ messages in thread
* usb: typec: altmodes/displayport: Fall back to multi-func pins
@ 2019-02-25 18:50 Hans de Goede
0 siblings, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2019-02-25 18:50 UTC (permalink / raw)
To: Heikki Krogerus; +Cc: Greg Kroah-Hartman, linux-usb
Hi Heikki,
On 25-02-19 16:49, Heikki Krogerus wrote:
> On Mon, Feb 25, 2019 at 01:56:37PM +0100, Hans de Goede wrote:
>> If our port-partner supports both DP-only operation (pin-assignment C)
>> and multi-func operation (pin-assignment D) and we only support
>> pin-assignment D and the port-partner prefers DP-only mode, then
>> before this commit we would and up masking out pin-assignment D from
>> the available pin-assignments and fail to pick a pin-assignment.
>>
>> Instead only mask out the multi-func pin-assignments if we support
>> dp-only pin-assignments, so that we correctly fall-back to a multi-func
>> pin-assignment in this case (by picking pin-assignment D).
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>
> Should this be handled as a fix?
AFAIK they are no users if this yet, until we've agreement
on the DT bindings and code merged for adding alt-modes
to an usb-connector node, nothing will be using this code,
so I see little use in adding a Cc: stable or some such.
Regards,
Hans
>
>> ---
>> drivers/usb/typec/altmodes/displayport.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c
>> index 3f06e94771a7..35161594e368 100644
>> --- a/drivers/usb/typec/altmodes/displayport.c
>> +++ b/drivers/usb/typec/altmodes/displayport.c
>> @@ -104,7 +104,7 @@ static int dp_altmode_configure(struct dp_altmode *dp, u8 con)
>> if (dp->data.status & DP_STATUS_PREFER_MULTI_FUNC &&
>> pin_assign & DP_PIN_ASSIGN_MULTI_FUNC_MASK)
>> pin_assign &= DP_PIN_ASSIGN_MULTI_FUNC_MASK;
>> - else
>> + else if (pin_assign & DP_PIN_ASSIGN_DP_ONLY_MASK)
>> pin_assign &= DP_PIN_ASSIGN_DP_ONLY_MASK;
>>
>> if (!pin_assign)
>> --
>> 2.20.1
>
> thanks,
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* usb: typec: altmodes/displayport: Fall back to multi-func pins
@ 2019-02-25 12:56 Hans de Goede
0 siblings, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2019-02-25 12:56 UTC (permalink / raw)
To: Greg Kroah-Hartman, Heikki Krogerus; +Cc: Hans de Goede, linux-usb
If our port-partner supports both DP-only operation (pin-assignment C)
and multi-func operation (pin-assignment D) and we only support
pin-assignment D and the port-partner prefers DP-only mode, then
before this commit we would and up masking out pin-assignment D from
the available pin-assignments and fail to pick a pin-assignment.
Instead only mask out the multi-func pin-assignments if we support
dp-only pin-assignments, so that we correctly fall-back to a multi-func
pin-assignment in this case (by picking pin-assignment D).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/usb/typec/altmodes/displayport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c
index 3f06e94771a7..35161594e368 100644
--- a/drivers/usb/typec/altmodes/displayport.c
+++ b/drivers/usb/typec/altmodes/displayport.c
@@ -104,7 +104,7 @@ static int dp_altmode_configure(struct dp_altmode *dp, u8 con)
if (dp->data.status & DP_STATUS_PREFER_MULTI_FUNC &&
pin_assign & DP_PIN_ASSIGN_MULTI_FUNC_MASK)
pin_assign &= DP_PIN_ASSIGN_MULTI_FUNC_MASK;
- else
+ else if (pin_assign & DP_PIN_ASSIGN_DP_ONLY_MASK)
pin_assign &= DP_PIN_ASSIGN_DP_ONLY_MASK;
if (!pin_assign)
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-03-15 14:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-25 15:49 usb: typec: altmodes/displayport: Fall back to multi-func pins Heikki Krogerus
-- strict thread matches above, loose matches on Subject: below --
2019-03-15 14:37 Heikki Krogerus
2019-02-27 8:50 Heikki Krogerus
2019-02-25 18:50 Hans de Goede
2019-02-25 12:56 Hans de Goede
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.