lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACr-zFCF_b0_3NSLFvtgfpAbsSwUOYv5fS==PPbn9zXPBS0NHw@mail.gmail.com>
Date: Sat, 22 Mar 2025 16:18:22 +0000
From: Christopher Obbard <christopher.obbard@...aro.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Andi Shyti <andi.shyti@...nel.org>, linux-i2c@...r.kernel.org, 
	linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Mukesh Kumar Savaliya <quic_msavaliy@...cinc.com>, Viken Dadhaniya <quic_vdadhani@...cinc.com>
Subject: Re: [PATCH v1 1/1] i2c: qcom-geni: Use generic definitions for bus frequencies

Hi Andy,

On Sat, 22 Mar 2025 at 14:59, Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> Since we have generic definitions for bus frequencies, let's use them.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>

Looks good to me.

Reviewed-by: Christopher Obbard <christopher.obbard@...aro.org>

> ---
>  drivers/i2c/busses/i2c-qcom-geni.c | 19 +++++++++----------
>  1 file changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
> index 515a784c951c..ccea575fb783 100644
> --- a/drivers/i2c/busses/i2c-qcom-geni.c
> +++ b/drivers/i2c/busses/i2c-qcom-geni.c
> @@ -71,7 +71,6 @@ enum geni_i2c_err_code {
>                                                                         << 5)
>
>  #define I2C_AUTO_SUSPEND_DELAY 250
> -#define KHZ(freq)              (1000 * freq)
>  #define PACKING_BYTES_PW       4
>
>  #define ABORT_TIMEOUT          HZ
> @@ -148,18 +147,18 @@ struct geni_i2c_clk_fld {
>   * source_clock = 19.2 MHz
>   */
>  static const struct geni_i2c_clk_fld geni_i2c_clk_map_19p2mhz[] = {
> -       {KHZ(100), 7, 10, 12, 26},
> -       {KHZ(400), 2,  5, 11, 22},
> -       {KHZ(1000), 1, 2,  8, 18},
> -       {},
> +       { I2C_MAX_STANDARD_MODE_FREQ, 7, 10, 12, 26 },
> +       { I2C_MAX_FAST_MODE_FREQ, 2,  5, 11, 22 },
> +       { I2C_MAX_FAST_MODE_PLUS_FREQ, 1, 2,  8, 18 },
> +       {}
>  };
>
>  /* source_clock = 32 MHz */
>  static const struct geni_i2c_clk_fld geni_i2c_clk_map_32mhz[] = {
> -       {KHZ(100), 8, 14, 18, 40},
> -       {KHZ(400), 4,  3, 11, 20},
> -       {KHZ(1000), 2, 3,  6, 15},
> -       {},
> +       { I2C_MAX_STANDARD_MODE_FREQ, 8, 14, 18, 40 },
> +       { I2C_MAX_FAST_MODE_FREQ, 4,  3, 11, 20 },
> +       { I2C_MAX_FAST_MODE_PLUS_FREQ, 2, 3,  6, 15 },
> +       {}
>  };
>
>  static int geni_i2c_clk_map_idx(struct geni_i2c_dev *gi2c)
> @@ -812,7 +811,7 @@ static int geni_i2c_probe(struct platform_device *pdev)
>                                        &gi2c->clk_freq_out);
>         if (ret) {
>                 dev_info(dev, "Bus frequency not specified, default to 100kHz.\n");
> -               gi2c->clk_freq_out = KHZ(100);
> +               gi2c->clk_freq_out = I2C_MAX_STANDARD_MODE_FREQ;
>         }
>
>         if (has_acpi_companion(dev))
> --
> 2.47.2
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ