mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yann Sionneau <yann@sionneau.net>
To: Huangzheng Lai <Huangzheng.Lai@unisoc.com>,
	Andi Shyti <andi.shyti@kernel.org>
Cc: Orson Zhai <orsonzhai@gmail.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	huangzheng lai <laihuangzheng@gmail.com>,
	Xiongpeng Wu <xiongpeng.wu@unisoc.com>
Subject: Re: [PATCH 1/8] i2c: sprd: Add configurations that support 1Mhz and 3.4Mhz frequencies
Date: Thu, 17 Aug 2023 16:05:44 +0200	[thread overview]
Message-ID: <e44e39b5-e989-6820-f283-9e3271048940@sionneau.net> (raw)
In-Reply-To: <20230817094520.21286-2-Huangzheng.Lai@unisoc.com>

Le 17/08/2023 à 11:45, Huangzheng Lai a écrit :
> This patch adds I2C controller driver support for 1Mhz and 3.4Mhz
> frequency configurations.
> @@ -347,6 +347,10 @@ static void sprd_i2c_set_clk(struct sprd_i2c *i2c_dev, u32 freq)
>   		writel((6 * apb_clk) / 10000000, i2c_dev->base + ADDR_STA0_DVD);
>   	else if (freq == I2C_MAX_STANDARD_MODE_FREQ)
>   		writel((4 * apb_clk) / 1000000, i2c_dev->base + ADDR_STA0_DVD);
> +	else if (freq == I2C_MAX_FAST_MODE_PLUS_FREQ)
> +		writel((8 * apb_clk) / 10000000, i2c_dev->base + ADDR_STA0_DVD);
> +	else if (freq == I2C_MAX_HIGH_SPEED_MODE_FREQ)
> +		writel((8 * apb_clk) / 10000000, i2c_dev->base + ADDR_STA0_DVD);
>   }

Maybe using a switch case could be beneficial to readability instead of 
a series of if / else if ?

-- 

Yann


  reply	other threads:[~2023-08-17 14:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-17  9:45 [PATCH 0/8] i2c: sprd: Modification of UNIOC Platform IIC Driver Huangzheng Lai
2023-08-17  9:45 ` [PATCH 1/8] i2c: sprd: Add configurations that support 1Mhz and 3.4Mhz frequencies Huangzheng Lai
2023-08-17 14:05   ` Yann Sionneau [this message]
2023-09-02 20:25   ` Andi Shyti
2023-08-17  9:45 ` [PATCH 2/8] i2c: sprd: Add I2C driver to use 'reset framework' function Huangzheng Lai
2023-08-17 14:07   ` Yann Sionneau
2023-09-02 20:30   ` Andi Shyti
2023-08-17  9:45 ` [PATCH 3/8] i2c: sprd: Use global variables to record IIC ack/nack status instead of local variables Huangzheng Lai
2023-08-31  7:04   ` Chunyan Zhang
2023-09-02 21:05   ` Andi Shyti
     [not found]     ` <CAAA1NbZt84f8vzmPbO_TH6hnvveyaiPhXpwjihRhJAEY9qw_Vg@mail.gmail.com>
2023-09-13  8:28       ` Chunyan Zhang
2023-09-13 12:28     ` huangzheng lai
2023-08-17  9:45 ` [PATCH 4/8] i2c: sprd: Add IIC controller driver to support dynamic switching of 400K/1M/3.4M frequency Huangzheng Lai
2023-08-31  7:44   ` Chunyan Zhang
2023-09-02 21:08     ` Andi Shyti
2023-09-04  3:27       ` Chunyan Zhang
2023-09-05 23:10         ` Andi Shyti
2023-08-17  9:45 ` [PATCH 5/8] i2c: sprd: Configure the enable bit of the IIC controller before each transmission initiation Huangzheng Lai
2023-08-31  8:09   ` Chunyan Zhang
2023-08-17  9:45 ` [PATCH 6/8] i2c: sprd: Add additional IIC control bit configuration to adapt to the new IP version of the UNISOC platform Huangzheng Lai
2023-08-31  7:50   ` Chunyan Zhang
2023-08-17  9:45 ` [PATCH 7/8] i2c: sprd: Set I2C_RX_ACK when clear irq Huangzheng Lai
2023-09-02 21:16   ` Andi Shyti
2023-08-17  9:45 ` [PATCH 8/8] i2c: sprd: Increase the waiting time for IIC transmission to avoid system crash issues Huangzheng Lai
2023-09-02 21:21   ` Andi Shyti
2023-08-24 16:44 ` [PATCH 0/8] i2c: sprd: Modification of UNIOC Platform IIC Driver 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=e44e39b5-e989-6820-f283-9e3271048940@sionneau.net \
    --to=yann@sionneau.net \
    --cc=Huangzheng.Lai@unisoc.com \
    --cc=andi.shyti@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=laihuangzheng@gmail.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=xiongpeng.wu@unisoc.com \
    --cc=zhang.lyra@gmail.com \
    /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

all inboxes | Powered by JetHome®