Re: [PATCH v1 24/40] i2c: owl: Use generic definitions for bus frequencies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 24, 2020 at 05:15:14PM +0200, Andy Shevchenko wrote:
> Since we have generic definitions for bus frequencies, let's use them.
> 
> Cc: "Andreas Färber" <afaerber@xxxxxxx>
> Cc: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>

Thanks,
Mani

> ---
>  drivers/i2c/busses/i2c-owl.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-owl.c b/drivers/i2c/busses/i2c-owl.c
> index b6b5a495118b..f9baeeb1a711 100644
> --- a/drivers/i2c/busses/i2c-owl.c
> +++ b/drivers/i2c/busses/i2c-owl.c
> @@ -87,9 +87,6 @@
>  
>  #define OWL_I2C_MAX_RETRIES	50
>  
> -#define OWL_I2C_DEF_SPEED_HZ	100000
> -#define OWL_I2C_MAX_SPEED_HZ	400000
> -
>  struct owl_i2c_dev {
>  	struct i2c_adapter	adap;
>  	struct i2c_msg		*msg;
> @@ -419,11 +416,11 @@ static int owl_i2c_probe(struct platform_device *pdev)
>  
>  	if (of_property_read_u32(dev->of_node, "clock-frequency",
>  				 &i2c_dev->bus_freq))
> -		i2c_dev->bus_freq = OWL_I2C_DEF_SPEED_HZ;
> +		i2c_dev->bus_freq = I2C_STANDARD_MODE_FREQ;
>  
>  	/* We support only frequencies of 100k and 400k for now */
> -	if (i2c_dev->bus_freq != OWL_I2C_DEF_SPEED_HZ &&
> -	    i2c_dev->bus_freq != OWL_I2C_MAX_SPEED_HZ) {
> +	if (i2c_dev->bus_freq != I2C_STANDARD_MODE_FREQ &&
> +	    i2c_dev->bus_freq != I2C_FAST_MODE_FREQ) {
>  		dev_err(dev, "invalid clock-frequency %d\n", i2c_dev->bus_freq);
>  		return -EINVAL;
>  	}
> -- 
> 2.25.0
> 



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux