[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2023082402-rearview-babbling-257c@gregkh>
Date: Thu, 24 Aug 2023 17:40:27 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Emmanuel Gil Peyrot <linkmauve@...kmauve.fr>
Cc: azkali <a.ffcc7@...il.com>, Adam Jiang <chaoj@...dia.com>,
CTCaer <ctcaer@...il.com>, Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Derek Kiernan <derek.kiernan@....com>,
Dragan Cvetic <dragan.cvetic@....com>,
Arnd Bergmann <arnd@...db.de>, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] misc: bm92txx: Add driver for the ROHM BM92Txx
On Thu, Aug 24, 2023 at 05:30:54PM +0200, Emmanuel Gil Peyrot wrote:
> From: azkali <a.ffcc7@...il.com>
>
> This is used as the USB-C Power Delivery controller of the Nintendo
> Switch.
>
> Signed-off-by: Emmanuel Gil Peyrot <linkmauve@...kmauve.fr>
> Signed-off-by: azkali <a.ffcc7@...il.com>
> Signed-off-by: Adam Jiang <chaoj@...dia.com>
> Signed-off-by: CTCaer <ctcaer@...il.com>
> ---
> MAINTAINERS | 1 +
> drivers/misc/Kconfig | 11 +
> drivers/misc/Makefile | 1 +
> drivers/misc/bm92txx.c | 2403 ++++++++++++++++++++++++++++++++++++++++
Why here and not in drivers/usb/typec/ ?
> 4 files changed, 2416 insertions(+)
> create mode 100644 drivers/misc/bm92txx.c
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index cc100a02fa7b..fe80d7693944 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -18457,6 +18457,7 @@ ROHM USB-C POWER DELIVERY CONTROLLERS
> M: Emmanuel Gil Peyrot <linkmauve@...kmauve.fr>
> S: Supported
> F: Documentation/devicetree/bindings/misc/rohm,bm92txx.yaml
> +F: drivers/misc/bm92txx.c
>
> ROSE NETWORK LAYER
> M: Ralf Baechle <ralf@...ux-mips.org>
> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> index 75e427f124b2..a2483819766a 100644
> --- a/drivers/misc/Kconfig
> +++ b/drivers/misc/Kconfig
> @@ -561,6 +561,17 @@ config TPS6594_PFSM
> This driver can also be built as a module. If so, the module
> will be called tps6594-pfsm.
>
> +config BM92TXX
> + tristate "Rohm Semiconductor BM92TXX USB Type-C Support"
> + depends on I2C=y
Why =y? That shouldn't matter, can't this just read:
depends on I2C
> +static int bm92t_read_reg(struct bm92t_info *info,
> + unsigned char reg, unsigned char *buf, int num)
> +{
> + struct i2c_msg xfer_msg[2];
> + int err;
> + unsigned char reg_addr;
> +
> + reg_addr = reg;
> +
> + xfer_msg[0].addr = info->i2c_client->addr;
> + xfer_msg[0].len = 1;
> + xfer_msg[0].flags = 0;
> + xfer_msg[0].buf = ®_addr;
> +
> + xfer_msg[1].addr = info->i2c_client->addr;
> + xfer_msg[1].len = num;
> + xfer_msg[1].flags = I2C_M_RD;
> + xfer_msg[1].buf = buf;
> +
> + err = i2c_transfer(info->i2c_client->adapter, xfer_msg, 2);
> + if (err < 0)
> + dev_err(&info->i2c_client->dev, "%s: transfer error %d\n", __func__, err);
There shouldn't be a need to put __func__ in a dev_*() call.
And why not use the device you have here, not the i2c client device?
Isn't the platform device the "correct" one that had the error?
thanks,
greg k-h
Powered by blists - more mailing lists