Skip to content

Commit

Permalink
media: I2C: change 'RST' to "RSET" to fix multiple build errors
Browse files Browse the repository at this point in the history
[ Upstream commit 8edcb50 ]

The use of an enum named 'RST' conflicts with a #define macro
named 'RST' in arch/mips/include/asm/mach-rc32434/rb.h.

The MIPS use of RST was there first (AFAICT), so change the
media/i2c/ uses of RST to be named 'RSET'.
'git grep -w RSET' does not report any naming conflicts with the
new name.

This fixes multiple build errors:

arch/mips/include/asm/mach-rc32434/rb.h:15:14: error: expected identifier before '(' token
   15 | #define RST  (1 << 15)
      |              ^
drivers/media/i2c/s5c73m3/s5c73m3.h:356:2: note: in expansion of macro 'RST'
  356 |  RST,
      |  ^~~

../arch/mips/include/asm/mach-rc32434/rb.h:15:14: error: expected identifier before '(' token
   15 | #define RST  (1 << 15)
      |              ^
../drivers/media/i2c/s5k6aa.c:180:2: note: in expansion of macro 'RST'
  180 |  RST,
      |  ^~~

../arch/mips/include/asm/mach-rc32434/rb.h:15:14: error: expected identifier before '(' token
   15 | #define RST  (1 << 15)
      |              ^
../drivers/media/i2c/s5k5baf.c:238:2: note: in expansion of macro 'RST'
  238 |  RST,
      |  ^~~

and some others that I have trimmed.

Fixes: cac47f1 ("[media] V4L: Add S5C73M3 camera driver")
Fixes: 8b99312 ("[media] Add v4l2 subdev driver for S5K4ECGX sensor")
Fixes: 7d45993 ("[media] Add driver for Samsung S5K5BAF camera sensor")
Fixes: bfa8dd3 ("[media] v4l: Add v4l2 subdev driver for S5K6AAFX sensor")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP Linux Team <linux-imx@nxp.com>
Cc: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Sangwook Lee <sangwook.lee@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
rddunlap authored and gregkh committed Jul 14, 2021
1 parent e7a376e commit b49d231
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions drivers/media/i2c/s5c73m3/s5c73m3-core.c
Expand Up @@ -1386,7 +1386,7 @@ static int __s5c73m3_power_on(struct s5c73m3 *state)
s5c73m3_gpio_deassert(state, STBY);
usleep_range(100, 200);

s5c73m3_gpio_deassert(state, RST);
s5c73m3_gpio_deassert(state, RSET);
usleep_range(50, 100);

return 0;
Expand All @@ -1401,7 +1401,7 @@ static int __s5c73m3_power_off(struct s5c73m3 *state)
{
int i, ret;

if (s5c73m3_gpio_assert(state, RST))
if (s5c73m3_gpio_assert(state, RSET))
usleep_range(10, 50);

if (s5c73m3_gpio_assert(state, STBY))
Expand Down Expand Up @@ -1606,7 +1606,7 @@ static int s5c73m3_get_platform_data(struct s5c73m3 *state)

state->mclk_frequency = pdata->mclk_frequency;
state->gpio[STBY] = pdata->gpio_stby;
state->gpio[RST] = pdata->gpio_reset;
state->gpio[RSET] = pdata->gpio_reset;
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/i2c/s5c73m3/s5c73m3.h
Expand Up @@ -353,7 +353,7 @@ struct s5c73m3_ctrls {

enum s5c73m3_gpio_id {
STBY,
RST,
RSET,
GPIO_NUM,
};

Expand Down
10 changes: 5 additions & 5 deletions drivers/media/i2c/s5k4ecgx.c
Expand Up @@ -173,7 +173,7 @@ static const char * const s5k4ecgx_supply_names[] = {

enum s5k4ecgx_gpio_id {
STBY,
RST,
RSET,
GPIO_NUM,
};

Expand Down Expand Up @@ -476,15 +476,15 @@ static int __s5k4ecgx_power_on(struct s5k4ecgx *priv)
if (s5k4ecgx_gpio_set_value(priv, STBY, priv->gpio[STBY].level))
usleep_range(30, 50);

if (s5k4ecgx_gpio_set_value(priv, RST, priv->gpio[RST].level))
if (s5k4ecgx_gpio_set_value(priv, RSET, priv->gpio[RSET].level))
usleep_range(30, 50);

return 0;
}

static int __s5k4ecgx_power_off(struct s5k4ecgx *priv)
{
if (s5k4ecgx_gpio_set_value(priv, RST, !priv->gpio[RST].level))
if (s5k4ecgx_gpio_set_value(priv, RSET, !priv->gpio[RSET].level))
usleep_range(30, 50);

if (s5k4ecgx_gpio_set_value(priv, STBY, !priv->gpio[STBY].level))
Expand Down Expand Up @@ -872,7 +872,7 @@ static int s5k4ecgx_config_gpios(struct s5k4ecgx *priv,
int ret;

priv->gpio[STBY].gpio = -EINVAL;
priv->gpio[RST].gpio = -EINVAL;
priv->gpio[RSET].gpio = -EINVAL;

ret = s5k4ecgx_config_gpio(gpio->gpio, gpio->level, "S5K4ECGX_STBY");

Expand All @@ -891,7 +891,7 @@ static int s5k4ecgx_config_gpios(struct s5k4ecgx *priv,
s5k4ecgx_free_gpios(priv);
return ret;
}
priv->gpio[RST] = *gpio;
priv->gpio[RSET] = *gpio;
if (gpio_is_valid(gpio->gpio))
gpio_set_value(gpio->gpio, 0);

Expand Down
6 changes: 3 additions & 3 deletions drivers/media/i2c/s5k5baf.c
Expand Up @@ -235,7 +235,7 @@ struct s5k5baf_gpio {

enum s5k5baf_gpio_id {
STBY,
RST,
RSET,
NUM_GPIOS,
};

Expand Down Expand Up @@ -969,7 +969,7 @@ static int s5k5baf_power_on(struct s5k5baf *state)

s5k5baf_gpio_deassert(state, STBY);
usleep_range(50, 100);
s5k5baf_gpio_deassert(state, RST);
s5k5baf_gpio_deassert(state, RSET);
return 0;

err_reg_dis:
Expand All @@ -987,7 +987,7 @@ static int s5k5baf_power_off(struct s5k5baf *state)
state->apply_cfg = 0;
state->apply_crop = 0;

s5k5baf_gpio_assert(state, RST);
s5k5baf_gpio_assert(state, RSET);
s5k5baf_gpio_assert(state, STBY);

if (!IS_ERR(state->clock))
Expand Down
10 changes: 5 additions & 5 deletions drivers/media/i2c/s5k6aa.c
Expand Up @@ -177,7 +177,7 @@ static const char * const s5k6aa_supply_names[] = {

enum s5k6aa_gpio_id {
STBY,
RST,
RSET,
GPIO_NUM,
};

Expand Down Expand Up @@ -841,7 +841,7 @@ static int __s5k6aa_power_on(struct s5k6aa *s5k6aa)
ret = s5k6aa->s_power(1);
usleep_range(4000, 5000);

if (s5k6aa_gpio_deassert(s5k6aa, RST))
if (s5k6aa_gpio_deassert(s5k6aa, RSET))
msleep(20);

return ret;
Expand All @@ -851,7 +851,7 @@ static int __s5k6aa_power_off(struct s5k6aa *s5k6aa)
{
int ret;

if (s5k6aa_gpio_assert(s5k6aa, RST))
if (s5k6aa_gpio_assert(s5k6aa, RSET))
usleep_range(100, 150);

if (s5k6aa->s_power) {
Expand Down Expand Up @@ -1510,7 +1510,7 @@ static int s5k6aa_configure_gpios(struct s5k6aa *s5k6aa,
int ret;

s5k6aa->gpio[STBY].gpio = -EINVAL;
s5k6aa->gpio[RST].gpio = -EINVAL;
s5k6aa->gpio[RSET].gpio = -EINVAL;

gpio = &pdata->gpio_stby;
if (gpio_is_valid(gpio->gpio)) {
Expand All @@ -1533,7 +1533,7 @@ static int s5k6aa_configure_gpios(struct s5k6aa *s5k6aa,
if (ret < 0)
return ret;

s5k6aa->gpio[RST] = *gpio;
s5k6aa->gpio[RSET] = *gpio;
}

return 0;
Expand Down

0 comments on commit b49d231

Please sign in to comment.