* [PATCH 0/2] ucsi driver fixes
@ 2020-01-08 13:13 Heikki Krogerus
2020-01-08 13:13 ` [PATCH 1/2] usb: typec: ucsi: Fix the notification bit offsets Heikki Krogerus
2020-01-08 13:13 ` [PATCH 2/2] usb: typec: ucsi: Actually enable all the interface notifications Heikki Krogerus
0 siblings, 2 replies; 5+ messages in thread
From: Heikki Krogerus @ 2020-01-08 13:13 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-usb
Hi Greg,
Here are two fixes for the ucsi driver. Both fix issues with the Set
Notification Enable command.
Heikki Krogerus (2):
usb: typec: ucsi: Fix the notification bit offsets
usb: typec: ucsi: Actually enable all the interface notifications
drivers/usb/typec/ucsi/ucsi.c | 1 +
drivers/usb/typec/ucsi/ucsi.h | 18 +++++++++---------
2 files changed, 10 insertions(+), 9 deletions(-)
--
2.24.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] usb: typec: ucsi: Fix the notification bit offsets
2020-01-08 13:13 [PATCH 0/2] ucsi driver fixes Heikki Krogerus
@ 2020-01-08 13:13 ` Heikki Krogerus
2020-01-08 13:13 ` [PATCH 2/2] usb: typec: ucsi: Actually enable all the interface notifications Heikki Krogerus
1 sibling, 0 replies; 5+ messages in thread
From: Heikki Krogerus @ 2020-01-08 13:13 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-usb
The bit offsets for the Set Notification Enable command were
not considering the reserved bits in the middle.
Fixes: 470ce43a1a81 ("usb: typec: ucsi: Remove struct ucsi_control")
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
drivers/usb/typec/ucsi/ucsi.h | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h
index 9e01a9556603..e434b9c9a9eb 100644
--- a/drivers/usb/typec/ucsi/ucsi.h
+++ b/drivers/usb/typec/ucsi/ucsi.h
@@ -99,15 +99,15 @@ void ucsi_connector_change(struct ucsi *ucsi, u8 num);
#define UCSI_ENABLE_NTFY_CMD_COMPLETE BIT(16)
#define UCSI_ENABLE_NTFY_EXT_PWR_SRC_CHANGE BIT(17)
#define UCSI_ENABLE_NTFY_PWR_OPMODE_CHANGE BIT(18)
-#define UCSI_ENABLE_NTFY_CAP_CHANGE BIT(19)
-#define UCSI_ENABLE_NTFY_PWR_LEVEL_CHANGE BIT(20)
-#define UCSI_ENABLE_NTFY_PD_RESET_COMPLETE BIT(21)
-#define UCSI_ENABLE_NTFY_CAM_CHANGE BIT(22)
-#define UCSI_ENABLE_NTFY_BAT_STATUS_CHANGE BIT(23)
-#define UCSI_ENABLE_NTFY_PARTNER_CHANGE BIT(24)
-#define UCSI_ENABLE_NTFY_PWR_DIR_CHANGE BIT(25)
-#define UCSI_ENABLE_NTFY_CONNECTOR_CHANGE BIT(26)
-#define UCSI_ENABLE_NTFY_ERROR BIT(27)
+#define UCSI_ENABLE_NTFY_CAP_CHANGE BIT(21)
+#define UCSI_ENABLE_NTFY_PWR_LEVEL_CHANGE BIT(22)
+#define UCSI_ENABLE_NTFY_PD_RESET_COMPLETE BIT(23)
+#define UCSI_ENABLE_NTFY_CAM_CHANGE BIT(24)
+#define UCSI_ENABLE_NTFY_BAT_STATUS_CHANGE BIT(25)
+#define UCSI_ENABLE_NTFY_PARTNER_CHANGE BIT(27)
+#define UCSI_ENABLE_NTFY_PWR_DIR_CHANGE BIT(28)
+#define UCSI_ENABLE_NTFY_CONNECTOR_CHANGE BIT(30)
+#define UCSI_ENABLE_NTFY_ERROR BIT(31)
#define UCSI_ENABLE_NTFY_ALL 0xdbe70000
/* SET_UOR command bits */
--
2.24.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] usb: typec: ucsi: Actually enable all the interface notifications
2020-01-08 13:13 [PATCH 0/2] ucsi driver fixes Heikki Krogerus
2020-01-08 13:13 ` [PATCH 1/2] usb: typec: ucsi: Fix the notification bit offsets Heikki Krogerus
@ 2020-01-08 13:13 ` Heikki Krogerus
2020-01-08 15:29 ` Heikki Krogerus
1 sibling, 1 reply; 5+ messages in thread
From: Heikki Krogerus @ 2020-01-08 13:13 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-usb
The notification mask was not updated properly before all
the notifications were enabled in ucsi_init().
Fixes: 71a1fa0df2a3 ("usb: typec: ucsi: Store the notification mask")
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
drivers/usb/typec/ucsi/ucsi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 466bd8afceea..59c8ccdc68ac 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -1007,6 +1007,7 @@ int ucsi_init(struct ucsi *ucsi)
}
/* Enable all notifications */
+ ucsi->ntfy = UCSI_ENABLE_NTFY_ALL;
command = UCSI_SET_NOTIFICATION_ENABLE | ucsi->ntfy;
ret = ucsi_run_command(ucsi, command, NULL, 0);
if (ret < 0)
--
2.24.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] usb: typec: ucsi: Actually enable all the interface notifications
2020-01-08 13:13 ` [PATCH 2/2] usb: typec: ucsi: Actually enable all the interface notifications Heikki Krogerus
@ 2020-01-08 15:29 ` Heikki Krogerus
2020-01-08 15:52 ` Greg Kroah-Hartman
0 siblings, 1 reply; 5+ messages in thread
From: Heikki Krogerus @ 2020-01-08 15:29 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-usb
Hi Greg,
On Wed, Jan 08, 2020 at 04:13:47PM +0300, Heikki Krogerus wrote:
> The notification mask was not updated properly before all
> the notifications were enabled in ucsi_init().
>
> Fixes: 71a1fa0df2a3 ("usb: typec: ucsi: Store the notification mask")
That commit (71a1fa0df2a3) is still in your usb-next branch, so this
patch should also go only to your usb-next.
Sorry about the mix-up.
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/ucsi/ucsi.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index 466bd8afceea..59c8ccdc68ac 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -1007,6 +1007,7 @@ int ucsi_init(struct ucsi *ucsi)
> }
>
> /* Enable all notifications */
> + ucsi->ntfy = UCSI_ENABLE_NTFY_ALL;
> command = UCSI_SET_NOTIFICATION_ENABLE | ucsi->ntfy;
> ret = ucsi_run_command(ucsi, command, NULL, 0);
> if (ret < 0)
> --
> 2.24.1
thanks,
--
heikki
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] usb: typec: ucsi: Actually enable all the interface notifications
2020-01-08 15:29 ` Heikki Krogerus
@ 2020-01-08 15:52 ` Greg Kroah-Hartman
0 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2020-01-08 15:52 UTC (permalink / raw)
To: Heikki Krogerus; +Cc: linux-usb
On Wed, Jan 08, 2020 at 05:29:42PM +0200, Heikki Krogerus wrote:
> Hi Greg,
>
> On Wed, Jan 08, 2020 at 04:13:47PM +0300, Heikki Krogerus wrote:
> > The notification mask was not updated properly before all
> > the notifications were enabled in ucsi_init().
> >
> > Fixes: 71a1fa0df2a3 ("usb: typec: ucsi: Store the notification mask")
>
> That commit (71a1fa0df2a3) is still in your usb-next branch, so this
> patch should also go only to your usb-next.
>
> Sorry about the mix-up.
No problem, I'll split the two patches between my two branches, thanks
for the heads-up.
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-01-08 15:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-08 13:13 [PATCH 0/2] ucsi driver fixes Heikki Krogerus
2020-01-08 13:13 ` [PATCH 1/2] usb: typec: ucsi: Fix the notification bit offsets Heikki Krogerus
2020-01-08 13:13 ` [PATCH 2/2] usb: typec: ucsi: Actually enable all the interface notifications Heikki Krogerus
2020-01-08 15:29 ` Heikki Krogerus
2020-01-08 15:52 ` Greg Kroah-Hartman
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).