diff mbox series

[v3,1/5] i2c: Introduce common module to instantiate CCGx UCSI

Message ID 20220105141935.24109-1-andriy.shevchenko@linux.intel.com
State Accepted
Headers show
Series [v3,1/5] i2c: Introduce common module to instantiate CCGx UCSI | expand

Commit Message

Andy Shevchenko Jan. 5, 2022, 2:19 p.m. UTC
Introduce a common module to provide an API to instantiate UCSI device
for Cypress CCGx Type-C controller. Individual bus drivers need to select
this one on demand.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v3: added MODULE_LICENSE(GPL); (Nehal-bakulchandra)
 drivers/i2c/busses/Kconfig         |  7 +++++++
 drivers/i2c/busses/Makefile        |  3 +++
 drivers/i2c/busses/i2c-ccgx-ucsi.c | 30 ++++++++++++++++++++++++++++++
 drivers/i2c/busses/i2c-ccgx-ucsi.h | 11 +++++++++++
 4 files changed, 51 insertions(+)
 create mode 100644 drivers/i2c/busses/i2c-ccgx-ucsi.c
 create mode 100644 drivers/i2c/busses/i2c-ccgx-ucsi.h

Comments

Andy Shevchenko Jan. 24, 2022, 3:06 p.m. UTC | #1
On Wed, Jan 05, 2022 at 04:19:31PM +0200, Andy Shevchenko wrote:
> Introduce a common module to provide an API to instantiate UCSI device
> for Cypress CCGx Type-C controller. Individual bus drivers need to select
> this one on demand.

Ajay, is it possible to get your tag on the series, please?
Andy Shevchenko Feb. 7, 2022, 1:13 p.m. UTC | #2
On Mon, Jan 24, 2022 at 05:06:47PM +0200, Andy Shevchenko wrote:
> On Wed, Jan 05, 2022 at 04:19:31PM +0200, Andy Shevchenko wrote:
> > Introduce a common module to provide an API to instantiate UCSI device
> > for Cypress CCGx Type-C controller. Individual bus drivers need to select
> > this one on demand.
> 
> Ajay, is it possible to get your tag on the series, please?

Wolfram, can you remind, please, what the process is, if there is
a non-responsive (in a meaningful period of time) maintainer?
Wolfram Sang Feb. 7, 2022, 2:14 p.m. UTC | #3
> > Ajay, is it possible to get your tag on the series, please?
> 
> Wolfram, can you remind, please, what the process is, if there is
> a non-responsive (in a meaningful period of time) maintainer?

Well, I can apply patches if there is no response but interest and
reasonable trust, of course. Your series has interest and trust. But
still, it may be nice to ping active people from Nvidia and ask about
Ajay.
Andy Shevchenko Feb. 7, 2022, 2:39 p.m. UTC | #4
On Mon, Feb 07, 2022 at 03:14:56PM +0100, Wolfram Sang wrote:
> 
> > > Ajay, is it possible to get your tag on the series, please?
> > 
> > Wolfram, can you remind, please, what the process is, if there is
> > a non-responsive (in a meaningful period of time) maintainer?
> 
> Well, I can apply patches if there is no response but interest and
> reasonable trust, of course. Your series has interest and trust. But
> still, it may be nice to ping active people from Nvidia and ask about
> Ajay.

Okay, I have Cc'ed this message to the people whose addresses I found in the
changes in the Git history of the vanilla kernel with most frequent appearance.

The Q is who is on nVidia side is responsible now for I²C controller driver?
Wolfram Sang Feb. 15, 2022, 9:07 a.m. UTC | #5
On Wed, Jan 05, 2022 at 04:19:31PM +0200, Andy Shevchenko wrote:
> Introduce a common module to provide an API to instantiate UCSI device
> for Cypress CCGx Type-C controller. Individual bus drivers need to select
> this one on demand.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied to for-next, thanks!
Wolfram Sang Feb. 15, 2022, 9:10 a.m. UTC | #6
> Okay, I have Cc'ed this message to the people whose addresses I found in the
> changes in the Git history of the vanilla kernel with most frequent appearance.
> 
> The Q is who is on nVidia side is responsible now for I²C controller driver?

I applied your series now. But the question where Ajay is or who now
maintains the i2c-nvidia-gpu driver still remains...
Andy Shevchenko Feb. 15, 2022, 9:45 a.m. UTC | #7
On Tue, Feb 15, 2022 at 10:10:09AM +0100, Wolfram Sang wrote:
> 
> > Okay, I have Cc'ed this message to the people whose addresses I found in the
> > changes in the Git history of the vanilla kernel with most frequent appearance.
> > 
> > The Q is who is on nVidia side is responsible now for I²C controller driver?
> 
> I applied your series now. But the question where Ajay is or who now
> maintains the i2c-nvidia-gpu driver still remains...

True. I dunno why nVidia guys are non-responsive for more than a week...
Maybe we should orphan the driver if no-one response in meaningful time
(let's say till the next merge window)?
Andy Shevchenko Feb. 15, 2022, 9:46 a.m. UTC | #8
On Tue, Feb 15, 2022 at 10:07:50AM +0100, Wolfram Sang wrote:
> On Wed, Jan 05, 2022 at 04:19:31PM +0200, Andy Shevchenko wrote:
> > Introduce a common module to provide an API to instantiate UCSI device
> > for Cypress CCGx Type-C controller. Individual bus drivers need to select
> > this one on demand.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Applied to for-next, thanks!

Thank you!

I hope at least AMD guys would be happy and can utilize this module for their
new hardware.
Wolfram Sang Feb. 15, 2022, 12:46 p.m. UTC | #9
> Maybe we should orphan the driver if no-one response in meaningful time
> (let's say till the next merge window)?

Yes, I had a similar idea.
Ajay Gupta Feb. 15, 2022, 5:41 p.m. UTC | #10
Hi Wolfram and Andy,

> -----Original Message-----
> From: Wolfram Sang <wsa@kernel.org>
> Sent: Tuesday, February 15, 2022 4:46 AM
> To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Thierry Reding <treding@nvidia.com>; linux-kernel@vger.kernel.org;
> linux-i2c@vger.kernel.org; Jarkko Nikula <jarkko.nikula@linux.intel.com>;
> Mika Westerberg <mika.westerberg@linux.intel.com>; Ajay Gupta
> <ajayg@nvidia.com>; Shah, Nehal-bakulchandra <nehal-
> bakulchandra.shah@amd.com>; Amit Cohen <amcohen@nvidia.com>;
> Nikolay Aleksandrov <nikolay@nvidia.com>; Sameer Pujar
> <spujar@nvidia.com>
> Subject: Re: [PATCH v3 1/5] i2c: Introduce common module to instantiate
> CCGx UCSI
> 
> 
> > Maybe we should orphan the driver if no-one response in meaningful
> > time (let's say till the next merge window)?
Sorry for the late response. The series looks good to me. I don't have setup ready
to test the changes but will be able to test next week and let you know if there is
any issues.

Thanks
Ajay
> nvpublic
> 
> Yes, I had a similar idea.
diff mbox series

Patch

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 42da31c1ab70..08e24e396e37 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -9,6 +9,13 @@  menu "I2C Hardware Bus support"
 comment "PC SMBus host controller drivers"
 	depends on PCI
 
+config I2C_CCGX_UCSI
+	tristate
+	help
+	  A common module to provide an API to instantiate UCSI device
+	  for Cypress CCGx Type-C controller. Individual bus drivers
+	  need to select this one on demand.
+
 config I2C_ALI1535
 	tristate "ALI 1535"
 	depends on PCI
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
index 1d00dce77098..79405cb5d600 100644
--- a/drivers/i2c/busses/Makefile
+++ b/drivers/i2c/busses/Makefile
@@ -6,6 +6,9 @@ 
 # ACPI drivers
 obj-$(CONFIG_I2C_SCMI)		+= i2c-scmi.o
 
+# Auxiliary I2C/SMBus modules
+obj-$(CONFIG_I2C_CCGX_UCSI)	+= i2c-ccgx-ucsi.o
+
 # PC SMBus host controller drivers
 obj-$(CONFIG_I2C_ALI1535)	+= i2c-ali1535.o
 obj-$(CONFIG_I2C_ALI1563)	+= i2c-ali1563.o
diff --git a/drivers/i2c/busses/i2c-ccgx-ucsi.c b/drivers/i2c/busses/i2c-ccgx-ucsi.c
new file mode 100644
index 000000000000..092dc92dea9f
--- /dev/null
+++ b/drivers/i2c/busses/i2c-ccgx-ucsi.c
@@ -0,0 +1,30 @@ 
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Instantiate UCSI device for Cypress CCGx Type-C controller.
+ * Derived from i2c-designware-pcidrv.c and i2c-nvidia-gpu.c.
+ */
+
+#include <linux/i2c.h>
+#include <linux/export.h>
+#include <linux/module.h>
+#include <linux/string.h>
+
+#include "i2c-ccgx-ucsi.h"
+
+struct software_node;
+
+struct i2c_client *i2c_new_ccgx_ucsi(struct i2c_adapter *adapter, int irq,
+				     const struct software_node *swnode)
+{
+	struct i2c_board_info info = {};
+
+	strscpy(info.type, "ccgx-ucsi", sizeof(info.type));
+	info.addr = 0x08;
+	info.irq = irq;
+	info.swnode = swnode;
+
+	return i2c_new_client_device(adapter, &info);
+}
+EXPORT_SYMBOL_GPL(i2c_new_ccgx_ucsi);
+
+MODULE_LICENSE("GPL");
diff --git a/drivers/i2c/busses/i2c-ccgx-ucsi.h b/drivers/i2c/busses/i2c-ccgx-ucsi.h
new file mode 100644
index 000000000000..739ac7a4b117
--- /dev/null
+++ b/drivers/i2c/busses/i2c-ccgx-ucsi.h
@@ -0,0 +1,11 @@ 
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef __I2C_CCGX_UCSI_H_
+#define __I2C_CCGX_UCSI_H_
+
+struct i2c_adapter;
+struct i2c_client;
+struct software_node;
+
+struct i2c_client *i2c_new_ccgx_ucsi(struct i2c_adapter *adapter, int irq,
+				     const struct software_node *swnode);
+#endif /* __I2C_CCGX_UCSI_H_ */