[v1,09/40] i2c: bcm-kona: Use generic definitions for bus frequencies
diff mbox series

Message ID 20200224151530.31713-9-andriy.shevchenko@linux.intel.com
State Superseded
Headers show
Series
  • [v1,01/40] i2c: qup: Move bus frequency definitions to i2c.h
Related show

Commit Message

Andy Shevchenko Feb. 24, 2020, 3:14 p.m. UTC
Since we have generic definitions for bus frequencies, let's use them.

Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Ray Jui <rjui@broadcom.com>
Cc: Scott Branden <sbranden@broadcom.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/i2c/busses/i2c-bcm-kona.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Scott Branden Feb. 24, 2020, 5:29 p.m. UTC | #1
On 2020-02-24 7:14 a.m., Andy Shevchenko wrote:
> Since we have generic definitions for bus frequencies, let's use them.
>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Ray Jui <rjui@broadcom.com>
> Cc: Scott Branden <sbranden@broadcom.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Scott Branden <scott.branden@broadcom.com>
> ---
>   drivers/i2c/busses/i2c-bcm-kona.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-bcm-kona.c b/drivers/i2c/busses/i2c-bcm-kona.c
> index 4e489a9d16fb..2858639767da 100644
> --- a/drivers/i2c/busses/i2c-bcm-kona.c
> +++ b/drivers/i2c/busses/i2c-bcm-kona.c
> @@ -722,16 +722,16 @@ static int bcm_kona_i2c_assign_bus_speed(struct bcm_kona_i2c_dev *dev)
>   	}
>   
>   	switch (bus_speed) {
> -	case 100000:
> +	case I2C_STANDARD_MODE_FREQ:
>   		dev->std_cfg = &std_cfg_table[BCM_SPD_100K];
>   		break;
> -	case 400000:
> +	case I2C_FAST_MODE_FREQ:
>   		dev->std_cfg = &std_cfg_table[BCM_SPD_400K];
>   		break;
> -	case 1000000:
> +	case I2C_FAST_MODE_PLUS_FREQ:
>   		dev->std_cfg = &std_cfg_table[BCM_SPD_1MHZ];
>   		break;
> -	case 3400000:
> +	case I2C_HIGH_SPEED_MODE_FREQ:
>   		/* Send mastercode at 100k */
>   		dev->std_cfg = &std_cfg_table[BCM_SPD_100K];
>   		dev->hs_cfg = &hs_cfg_table[BCM_SPD_3P4MHZ];

Patch
diff mbox series

diff --git a/drivers/i2c/busses/i2c-bcm-kona.c b/drivers/i2c/busses/i2c-bcm-kona.c
index 4e489a9d16fb..2858639767da 100644
--- a/drivers/i2c/busses/i2c-bcm-kona.c
+++ b/drivers/i2c/busses/i2c-bcm-kona.c
@@ -722,16 +722,16 @@  static int bcm_kona_i2c_assign_bus_speed(struct bcm_kona_i2c_dev *dev)
 	}
 
 	switch (bus_speed) {
-	case 100000:
+	case I2C_STANDARD_MODE_FREQ:
 		dev->std_cfg = &std_cfg_table[BCM_SPD_100K];
 		break;
-	case 400000:
+	case I2C_FAST_MODE_FREQ:
 		dev->std_cfg = &std_cfg_table[BCM_SPD_400K];
 		break;
-	case 1000000:
+	case I2C_FAST_MODE_PLUS_FREQ:
 		dev->std_cfg = &std_cfg_table[BCM_SPD_1MHZ];
 		break;
-	case 3400000:
+	case I2C_HIGH_SPEED_MODE_FREQ:
 		/* Send mastercode at 100k */
 		dev->std_cfg = &std_cfg_table[BCM_SPD_100K];
 		dev->hs_cfg = &hs_cfg_table[BCM_SPD_3P4MHZ];