diff mbox series

[3/7] usb: typec: ucsi: add port num info

Message ID 20190118010909.16161-4-ajayg@nvidia.com (mailing list archive)
State New, archived
Headers show
Series Add support for firmware update on Cypres CCGx | expand

Commit Message

Ajay Gupta Jan. 18, 2019, 1:09 a.m. UTC
Read PD port number information and save.

Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
---
 drivers/usb/typec/ucsi/ucsi_ccg.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
index dce9126b6a37..b30ca51120a3 100644
--- a/drivers/usb/typec/ucsi/ucsi_ccg.c
+++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
@@ -172,6 +172,7 @@  struct ucsi_ccg {
 #define DEV_CMD_PENDING	1
 	struct ccg_resp dev_resp;
 	u8 cmd_resp;
+	int port_num;
 };
 
 static int ccg_read(struct ucsi_ccg *uc, u16 rab, u8 *data, u32 len)
@@ -554,6 +555,11 @@  static int ucsi_ccg_probe(struct i2c_client *client,
 		return status;
 	}
 
+	if (uc->info.two_pd_ports)
+		uc->port_num = 2;
+	else
+		uc->port_num = 1;
+
 	status = devm_request_threaded_irq(dev, client->irq, NULL,
 					   ccg_irq_handler,
 					   IRQF_ONESHOT | IRQF_TRIGGER_HIGH,