Linux-i2c Archive mirror
 help / color / mirror / Atom feed
From: Hans Hu <HansHu-oc@zhaoxin.com>
To: Andi Shyti <andi.shyti@kernel.org>
Cc: <wsa@kernel.org>, <linux-i2c@vger.kernel.org>, <cobechen@zhaoxin.com>
Subject: Re: [PATCH v6 5/8] i2c: wmt: rename with prefix VIAI2C_ and viai2c_
Date: Thu, 4 Jan 2024 10:12:42 +0800	[thread overview]
Message-ID: <83d535cc-8211-416e-b497-eb970aff445b@zhaoxin.com> (raw)
In-Reply-To: <20240103184544.7mugspjz7cyhn7jk@zenone.zhora.eu>


On 2024/1/4 02:45, Andi Shyti wrote:
> Hi Hans,
>
> On Fri, Dec 29, 2023 at 02:30:36PM +0800, Hans Hu wrote:
>> Since the I2C IP of both wmt and zhaoxin come from VIA.
>> So, rename common register, function and variable's name
>> to VIAI2C_ and viai2c_.
> this commit is not really clear. Can we write something like:
>
> "The I2C IP for both wmt and zhaoxin originates from VIA. Rename
> common registers, functions, and variable names to follow the
> VIAI2C_ and viai2c_ naming conventions for consistency and
> clarity."


ok, will change this.


>> Signed-off-by: Hans Hu <hanshu-oc@zhaoxin.com>
> [...]
>
>> -#define WMTI2C_REG_CR		0x00
>> -#define WMTI2C_CR_TX_NEXT_ACK		0x0000
>> -#define WMTI2C_CR_ENABLE		0x0001
>> -#define WMTI2C_CR_TX_NEXT_NO_ACK	0x0002
>> -#define WMTI2C_CR_TX_END		0x0004
>> -#define WMTI2C_CR_CPU_RDY		0x0008
>> +#define VIAI2C_REG_CR		0x00
>> +#define VIAI2C_CR_ENABLE		BIT(0)
>> +#define VIAI2C_CR_RX_END		BIT(1)
>> +#define VIAI2C_CR_TX_END		BIT(2)
>> +#define VIAI2C_CR_CPU_RDY		BIT(3)
>> +#define VIAI2C_CR_END_MASK		GENMASK(2, 1)
>>   
>>   /* REG_TCR Bit fields */
>> -#define WMTI2C_REG_TCR		0x02
>> -#define WMTI2C_TCR_STANDARD_MODE	0x0000
>> -#define WMTI2C_TCR_MASTER_WRITE		0x0000
>> -#define WMTI2C_TCR_HS_MODE		0x2000
>> -#define WMTI2C_TCR_MASTER_READ		0x4000
>> -#define WMTI2C_TCR_FAST_MODE		0x8000
>> -#define WMTI2C_TCR_SLAVE_ADDR_MASK	0x007F
>> +#define VIAI2C_REG_TCR		0x02
>> +#define VIAI2C_TCR_MASTER_WRITE		0x0000
>> +#define VIAI2C_TCR_HS_MODE		BIT(13)
>> +#define VIAI2C_TCR_MASTER_READ		BIT(14)
>> +#define VIAI2C_TCR_FAST			BIT(15)
>> +#define VIAI2C_TCR_SLAVE_ADDR_MASK	GENMASK(6, 0)
>>   
>>   /* REG_CSR Bit fields */
>> -#define WMTI2C_REG_CSR		0x04
>> -#define WMTI2C_CSR_RCV_NOT_ACK		0x0001
>> -#define WMTI2C_CSR_RCV_ACK_MASK		0x0001
>> -#define WMTI2C_CSR_READY_MASK		0x0002
>> +#define VIAI2C_REG_CSR		0x04
>> +#define VIAI2C_CSR_RCV_NOT_ACK		BIT(0)
>> +#define VIAI2C_CSR_RCV_ACK_MASK		BIT(0)
>> +#define VIAI2C_CSR_READY_MASK		BIT(1)
>>   
>>   /* REG_ISR Bit fields */
>> -#define WMTI2C_REG_ISR		0x06
>> -#define WMTI2C_ISR_NACK_ADDR		0x0001
>> -#define WMTI2C_ISR_BYTE_END		0x0002
>> -#define WMTI2C_ISR_SCL_TIMEOUT		0x0004
>> -#define WMTI2C_ISR_WRITE_ALL		0x0007
>> +#define VIAI2C_REG_ISR		0x06
>> +#define VIAI2C_ISR_NACK_ADDR		BIT(0)
>> +#define VIAI2C_ISR_BYTE_END		BIT(1)
>> +#define VIAI2C_ISR_SCL_TIMEOUT		BIT(2)
>> +#define VIAI2C_ISR_MASK_ALL		GENMASK(2, 0)
>>   
>>   /* REG_IMR Bit fields */
>> -#define WMTI2C_REG_IMR		0x08
>> -#define WMTI2C_IMR_ENABLE_ALL		0x0007
>> +#define VIAI2C_REG_IMR		0x08
>> +#define VIAI2C_IMR_BYTE			BIT(1)
>> +#define VIAI2C_IMR_ENABLE_ALL		GENMASK(2, 0)
>>   
>> -#define WMTI2C_REG_CDR		0x0A
>> -#define WMTI2C_REG_TR		0x0C
>> -#define WMTI2C_REG_MCR		0x0E
>> +#define VIAI2C_REG_CDR		0x0A
>> +#define VIAI2C_REG_TR		0x0C
>> +#define VIAI2C_REG_MCR		0x0E
> These defines have been changed twice in this series. The patches
> should be rearranged in order to avoid this.
>
> I Wolfram is not against, I'm OK with letting it slip this time.


I also realize that repetition is not good,
I only did this in the hope that patches would be easier to review.


>> -struct wmt_i2c {
>> +struct viai2c {
>>   	struct i2c_adapter	adapter;
>>   	struct completion	complete;
>>   	struct device		*dev;
>> @@ -60,7 +60,7 @@ struct wmt_i2c {
>>   	u16			cmd_status;
>>   };
>>   
>> -int wmt_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num);
>> -int wmt_i2c_init(struct platform_device *pdev, struct wmt_i2c **pi2c);
>> +int viai2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num);
>> +int viai2c_init(struct platform_device *pdev, struct viai2c **pi2c);
>>   
>>   #endif
>> diff --git a/drivers/i2c/busses/i2c-wmt-plt.c b/drivers/i2c/busses/i2c-wmt-plt.c
>> index e0ffccf8a40a..8f506888cff7 100644
>> --- a/drivers/i2c/busses/i2c-wmt-plt.c
>> +++ b/drivers/i2c/busses/i2c-wmt-plt.c
>> @@ -22,13 +22,15 @@
>>   #define WMTI2C_MCR_APB_96M		7
>>   #define WMTI2C_MCR_APB_166M		12
>>   
>> +#define wmt_i2c				viai2c
> no, please, do not redefine types. Besides This looks a bit
> dangerous and reckless to me :-)


ok, will use viai2c directly.


>
> Andi

  reply	other threads:[~2024-01-04  2:12 UTC|newest]

Thread overview: 133+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02  2:53 [PATCH v3 00/12] i2c: add zhaoxin i2c controller driver Hans Hu
2023-11-02  2:53 ` [PATCH v3 01/12] i2c: wmt: Reduce redundant: bus busy check Hans Hu
2023-12-22  9:33   ` Wolfram Sang
2023-11-02  2:53 ` [PATCH v3 02/12] i2c: wmt: Reduce redundant: wait event complete Hans Hu
2023-12-22  9:34   ` Wolfram Sang
2023-11-02  2:53 ` [PATCH v3 03/12] i2c: wmt: Reduce redundant: clock mode setting Hans Hu
2023-12-22  9:36   ` Wolfram Sang
2023-11-02  2:53 ` [PATCH v3 04/12] i2c: wmt: Reduce redundant: REG_CR setting Hans Hu
2023-12-22  9:38   ` Wolfram Sang
2023-12-22 10:15     ` Wolfram Sang
2023-11-02  2:53 ` [PATCH v3 05/12] i2c: wmt: Reduce redundant: function parameter Hans Hu
2023-12-22  9:48   ` Wolfram Sang
2023-11-02  2:53 ` [PATCH v3 06/12] i2c: wmt: delete .remove_new Hans Hu
2023-12-22  9:51   ` Wolfram Sang
2023-11-02  2:53 ` [PATCH v3 07/12] i2c: wmt: create wmt_i2c_init for general init Hans Hu
2023-12-22 10:26   ` Wolfram Sang
2023-12-22 10:55     ` Hans Hu
2023-12-22 11:00       ` Wolfram Sang
2023-11-02  2:53 ` [PATCH v3 08/12] i2c: wmt: rename marcos with prefix WMTI2C_ Hans Hu
2023-11-02  2:53 ` [PATCH v3 09/12] i2c: wmt: adjust line length to meet style Hans Hu
2023-11-02  2:54 ` [PATCH v3 10/12] i2c: wmt: split out common files Hans Hu
2023-11-02  2:54 ` [PATCH v3 11/12] i2c: via-common: add zhaoxin platform Hans Hu
2023-11-02  2:54 ` [PATCH v3 12/12] i2c: add zhaoxin i2c controller driver Hans Hu
2023-11-08  9:50 ` [PATCH v3 00/12] " Wolfram Sang
2023-12-27  4:39 ` [PATCH v4 0/8] " Hans Hu
2023-12-27  4:39   ` [PATCH v4 1/8] i2c: wmt: create wmt_i2c_init for general init Hans Hu
2023-12-27 19:00     ` Wolfram Sang
2023-12-28  2:05       ` Hans Hu
2023-12-27  4:39   ` [PATCH v4 2/8] i2c: wmt: rename marcos with prefix WMTI2C_ Hans Hu
2023-12-27  4:39   ` [PATCH v4 3/8] i2c: wmt: adjust line length to meet style Hans Hu
2023-12-27  4:39   ` [PATCH v4 4/8] i2c: wmt: split out common files Hans Hu
2023-12-27  4:39   ` [PATCH v4 5/8] i2c: wmt: rename with prefix VIAI2C_ and viai2c_ Hans Hu
2023-12-27  4:39   ` [PATCH v4 6/8] i2c: wmt: fix a bug when thread blocked Hans Hu
2023-12-27  4:39   ` [PATCH v4 7/8] i2c: wmt: add platform type VIAI2C_PLAT_WMT Hans Hu
2023-12-27  4:39   ` [PATCH v4 8/8] i2c: add zhaoxin i2c controller driver Hans Hu
2023-12-28  3:17   ` [PATCH v5 0/8] " Hans Hu
2023-12-28  3:17     ` [PATCH v5 1/8] i2c: wmt: create wmt_i2c_init for general init Hans Hu
2023-12-28  3:17     ` [PATCH v5 2/8] i2c: wmt: rename marcos with prefix WMTI2C_ Hans Hu
2023-12-28  3:17     ` [PATCH v5 3/8] i2c: wmt: adjust line length to meet style Hans Hu
2023-12-28  3:17     ` [PATCH v5 4/8] i2c: wmt: split out common files Hans Hu
2023-12-28  3:17     ` [PATCH v5 5/8] i2c: wmt: rename with prefix VIAI2C_ and viai2c_ Hans Hu
2023-12-28  3:17     ` [PATCH v5 6/8] i2c: wmt: fix a bug when thread blocked Hans Hu
2023-12-28  3:17     ` [PATCH v5 7/8] i2c: wmt: add platform type VIAI2C_PLAT_WMT Hans Hu
2023-12-28  3:17     ` [PATCH v5 8/8] i2c: add zhaoxin i2c controller driver Hans Hu
2023-12-29  5:17       ` kernel test robot
2023-12-29  6:30     ` [PATCH v6 0/8] " Hans Hu
2023-12-29  6:30       ` [PATCH v6 1/8] i2c: wmt: create wmt_i2c_init for general init Hans Hu
2024-01-03 12:56         ` Andi Shyti
2024-01-04  1:44           ` Hans Hu
2023-12-29  6:30       ` [PATCH v6 2/8] i2c: wmt: rename marcos with prefix WMTI2C_ Hans Hu
2024-01-03 13:29         ` Andi Shyti
2023-12-29  6:30       ` [PATCH v6 3/8] i2c: wmt: adjust line length to meet style Hans Hu
2024-01-03 16:52         ` Andi Shyti
2024-01-04  1:49           ` Hans Hu
2023-12-29  6:30       ` [PATCH v6 4/8] i2c: wmt: split out common files Hans Hu
2024-01-03 17:21         ` Andi Shyti
2024-01-04  2:04           ` Hans Hu
2024-01-04  9:22             ` Andi Shyti
2024-01-04  9:45               ` Hans Hu
2024-01-04 12:36                 ` Andi Shyti
2023-12-29  6:30       ` [PATCH v6 5/8] i2c: wmt: rename with prefix VIAI2C_ and viai2c_ Hans Hu
2024-01-03 18:45         ` Andi Shyti
2024-01-04  2:12           ` Hans Hu [this message]
2023-12-29  6:30       ` [PATCH v6 6/8] i2c: wmt: fix a bug when thread blocked Hans Hu
2024-01-03 19:39         ` Andi Shyti
2024-01-04  2:30           ` Hans Hu
2024-01-04  9:18             ` Andi Shyti
2024-01-04 10:02               ` Hans Hu
2024-01-04 12:37                 ` Andi Shyti
2023-12-29  6:30       ` [PATCH v6 7/8] i2c: wmt: add platform type VIAI2C_PLAT_WMT Hans Hu
2023-12-29  6:30       ` [PATCH v6 8/8] i2c: add zhaoxin i2c controller driver Hans Hu
2024-01-03 20:02         ` Andi Shyti
2024-01-04  2:40           ` Hans Hu
2024-01-03 20:03       ` [PATCH v6 0/8] " Andi Shyti
2024-01-05  7:51       ` [PATCH v7 0/6] " Hans Hu
2024-01-05  7:51         ` [PATCH v7 1/6] i2c: wmt: create wmt_i2c_init for general init Hans Hu
2024-01-15 15:17           ` Krzysztof Kozlowski
2024-01-16  1:43             ` Hans Hu
2024-01-21 23:56               ` Andi Shyti
2024-02-21 12:10           ` Wolfram Sang
2024-01-05  7:51         ` [PATCH v7 2/6] i2c: wmt: split out common files Hans Hu
2024-02-21 12:19           ` Wolfram Sang
2024-01-05  7:51         ` [PATCH v7 3/6] i2c: wmt: rename something Hans Hu
2024-02-21 12:34           ` Wolfram Sang
2024-01-05  7:51         ` [PATCH v7 4/6] i2c: wmt: fix a bug when thread blocked Hans Hu
2024-02-21 12:37           ` Wolfram Sang
2024-02-22  9:03             ` Hans Hu
2024-02-22  9:37               ` Wolfram Sang
2024-02-22 10:42                 ` Hans Hu
2024-02-22 17:26                   ` Wolfram Sang
2024-01-05  7:51         ` [PATCH v7 5/6] i2c: wmt: add platform type VIAI2C_PLAT_WMT Hans Hu
2024-02-21 12:39           ` Wolfram Sang
2024-02-22  8:50             ` Hans Hu
2024-01-05  7:51         ` [PATCH v7 6/6] i2c: add zhaoxin i2c controller driver Hans Hu
2024-02-21 12:44           ` Wolfram Sang
2024-02-22  8:49             ` Hans Hu
2024-02-27  6:36         ` [PATCH v8 0/6] " Hans Hu
2024-02-27  6:36           ` [PATCH v8 1/6] i2c: wmt: create wmt_i2c_init for general init Hans Hu
2024-02-27  6:36           ` [PATCH v8 2/6] i2c: wmt: split out common files Hans Hu
2024-02-27  6:36           ` [PATCH v8 3/6] i2c: wmt: rename something Hans Hu
2024-02-27  6:36           ` [PATCH v8 4/6] i2c: wmt: fix a bug when thread blocked Hans Hu
2024-03-04  9:41             ` Wolfram Sang
2024-02-27  6:36           ` [PATCH v8 5/6] i2c: wmt: add platform type VIAI2C_PLAT_WMT Hans Hu
2024-03-04  9:46             ` Wolfram Sang
2024-02-27  6:36           ` [PATCH v8 6/6] i2c: add zhaoxin i2c controller driver Hans Hu
2024-03-04  9:49             ` Wolfram Sang
2024-03-04 23:01               ` [SPAM] " Andi Shyti
2024-03-05  2:45                 ` Hans Hu
2024-03-06 11:50                   ` Andi Shyti
2024-03-06 16:54                   ` Wolfram Sang
2024-03-06 21:24           ` [PATCH v9 0/6] " Andi Shyti
2024-03-06 21:24             ` [PATCH v9 1/6] i2c: wmt: create wmt_i2c_init for general init Andi Shyti
2024-03-06 21:24             ` [PATCH v9 2/6] i2c: wmt: split out common files Andi Shyti
2024-03-06 21:24             ` [PATCH v9 3/6] i2c: wmt: rename something Andi Shyti
2024-03-06 21:24             ` [PATCH v9 4/6] i2c: wmt: fix a bug when thread blocked Andi Shyti
2024-03-06 21:24             ` [PATCH v9 5/6] i2c: wmt: add platform type VIAI2C_PLAT_WMT Andi Shyti
2024-03-06 21:24             ` [PATCH v9 6/6] i2c: add zhaoxin i2c controller driver Andi Shyti
2024-03-08  1:22             ` [PATCH v9 0/6] " Hans Hu
2024-03-08 12:30               ` Andi Shyti
2024-04-03 23:29               ` Andi Shyti
2024-04-07  1:36                 ` Hans Hu
2024-04-08  2:54             ` [PATCH v10 " Hans Hu
2024-04-08  2:54               ` [PATCH v10 1/6] i2c: wmt: create wmt_i2c_init for general init Hans Hu
2024-04-23 11:23                 ` Andi Shyti
2024-04-08  2:54               ` [PATCH v10 2/6] i2c: wmt: split out common files Hans Hu
2024-04-08  2:54               ` [PATCH v10 3/6] i2c: wmt: rename something Hans Hu
2024-04-23 11:54                 ` Andi Shyti
2024-04-08  2:54               ` [PATCH v10 4/6] i2c: wmt: fix a bug when thread blocked Hans Hu
2024-04-08  2:54               ` [PATCH v10 5/6] i2c: wmt: add platform type VIAI2C_PLAT_WMT Hans Hu
2024-04-08  2:54               ` [PATCH v10 6/6] i2c: add zhaoxin i2c controller driver Hans Hu
2024-04-23 12:02               ` [PATCH v10 0/6] " Andi Shyti
2024-04-23 12:16                 ` Hans Hu
2024-04-29  0:20               ` Andi Shyti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83d535cc-8211-416e-b497-eb970aff445b@zhaoxin.com \
    --to=hanshu-oc@zhaoxin.com \
    --cc=andi.shyti@kernel.org \
    --cc=cobechen@zhaoxin.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).