Commit 9fb1f39e authored by Linus Walleij's avatar Linus Walleij

gpio/pinctrl: make gpio_chip members typed boolean

This switches the two members of struct gpio_chip that were
defined as unsigned foo:1 to bool, because that is indeed what
they are. Switch all users in the gpio and pinctrl subsystems
to assign these values with true/false instead of 0/1. The
users outside these subsystems will survive since true/false
is 1/0, atleast we set some kind of more strict typing example.
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent b7d0a28a
...@@ -159,7 +159,7 @@ static int gen_74x164_probe(struct spi_device *spi) ...@@ -159,7 +159,7 @@ static int gen_74x164_probe(struct spi_device *spi)
goto exit_destroy; goto exit_destroy;
} }
chip->gpio_chip.can_sleep = 1; chip->gpio_chip.can_sleep = true;
chip->gpio_chip.dev = &spi->dev; chip->gpio_chip.dev = &spi->dev;
chip->gpio_chip.owner = THIS_MODULE; chip->gpio_chip.owner = THIS_MODULE;
......
...@@ -260,7 +260,7 @@ static int adnp_gpio_setup(struct adnp *adnp, unsigned int num_gpios) ...@@ -260,7 +260,7 @@ static int adnp_gpio_setup(struct adnp *adnp, unsigned int num_gpios)
chip->direction_output = adnp_gpio_direction_output; chip->direction_output = adnp_gpio_direction_output;
chip->get = adnp_gpio_get; chip->get = adnp_gpio_get;
chip->set = adnp_gpio_set; chip->set = adnp_gpio_set;
chip->can_sleep = 1; chip->can_sleep = true;
if (IS_ENABLED(CONFIG_DEBUG_FS)) if (IS_ENABLED(CONFIG_DEBUG_FS))
chip->dbg_show = adnp_gpio_dbg_show; chip->dbg_show = adnp_gpio_dbg_show;
......
...@@ -127,7 +127,7 @@ static int adp5520_gpio_probe(struct platform_device *pdev) ...@@ -127,7 +127,7 @@ static int adp5520_gpio_probe(struct platform_device *pdev)
gc->direction_output = adp5520_gpio_direction_output; gc->direction_output = adp5520_gpio_direction_output;
gc->get = adp5520_gpio_get_value; gc->get = adp5520_gpio_get_value;
gc->set = adp5520_gpio_set_value; gc->set = adp5520_gpio_set_value;
gc->can_sleep = 1; gc->can_sleep = true;
gc->base = pdata->gpio_start; gc->base = pdata->gpio_start;
gc->ngpio = gpios; gc->ngpio = gpios;
......
...@@ -380,7 +380,7 @@ static int adp5588_gpio_probe(struct i2c_client *client, ...@@ -380,7 +380,7 @@ static int adp5588_gpio_probe(struct i2c_client *client,
gc->direction_output = adp5588_gpio_direction_output; gc->direction_output = adp5588_gpio_direction_output;
gc->get = adp5588_gpio_get_value; gc->get = adp5588_gpio_get_value;
gc->set = adp5588_gpio_set_value; gc->set = adp5588_gpio_set_value;
gc->can_sleep = 1; gc->can_sleep = true;
gc->base = pdata->gpio_start; gc->base = pdata->gpio_start;
gc->ngpio = ADP5588_MAXGPIO; gc->ngpio = ADP5588_MAXGPIO;
......
...@@ -91,7 +91,7 @@ static struct gpio_chip template_chip = { ...@@ -91,7 +91,7 @@ static struct gpio_chip template_chip = {
.get = arizona_gpio_get, .get = arizona_gpio_get,
.direction_output = arizona_gpio_direction_out, .direction_output = arizona_gpio_direction_out,
.set = arizona_gpio_set, .set = arizona_gpio_set,
.can_sleep = 1, .can_sleep = true,
}; };
static int arizona_gpio_probe(struct platform_device *pdev) static int arizona_gpio_probe(struct platform_device *pdev)
......
...@@ -169,7 +169,7 @@ static void bt8xxgpio_gpio_setup(struct bt8xxgpio *bg) ...@@ -169,7 +169,7 @@ static void bt8xxgpio_gpio_setup(struct bt8xxgpio *bg)
c->dbg_show = NULL; c->dbg_show = NULL;
c->base = modparam_gpiobase; c->base = modparam_gpiobase;
c->ngpio = BT8XXGPIO_NR_GPIOS; c->ngpio = BT8XXGPIO_NR_GPIOS;
c->can_sleep = 0; c->can_sleep = false;
} }
static int bt8xxgpio_probe(struct pci_dev *dev, static int bt8xxgpio_probe(struct pci_dev *dev,
......
...@@ -200,7 +200,7 @@ static struct gpio_chip reference_gp = { ...@@ -200,7 +200,7 @@ static struct gpio_chip reference_gp = {
.direction_input = da9052_gpio_direction_input, .direction_input = da9052_gpio_direction_input,
.direction_output = da9052_gpio_direction_output, .direction_output = da9052_gpio_direction_output,
.to_irq = da9052_gpio_to_irq, .to_irq = da9052_gpio_to_irq,
.can_sleep = 1, .can_sleep = true,
.ngpio = 16, .ngpio = 16,
.base = -1, .base = -1,
}; };
......
...@@ -134,7 +134,7 @@ static struct gpio_chip reference_gp = { ...@@ -134,7 +134,7 @@ static struct gpio_chip reference_gp = {
.direction_input = da9055_gpio_direction_input, .direction_input = da9055_gpio_direction_input,
.direction_output = da9055_gpio_direction_output, .direction_output = da9055_gpio_direction_output,
.to_irq = da9055_gpio_to_irq, .to_irq = da9055_gpio_to_irq,
.can_sleep = 1, .can_sleep = true,
.ngpio = 3, .ngpio = 3,
.base = -1, .base = -1,
}; };
......
...@@ -252,7 +252,7 @@ static void ichx_gpiolib_setup(struct gpio_chip *chip) ...@@ -252,7 +252,7 @@ static void ichx_gpiolib_setup(struct gpio_chip *chip)
chip->direction_output = ichx_gpio_direction_output; chip->direction_output = ichx_gpio_direction_output;
chip->base = modparam_gpiobase; chip->base = modparam_gpiobase;
chip->ngpio = ichx_priv.desc->ngpio; chip->ngpio = ichx_priv.desc->ngpio;
chip->can_sleep = 0; chip->can_sleep = false;
chip->dbg_show = NULL; chip->dbg_show = NULL;
} }
......
...@@ -425,7 +425,7 @@ static int intel_gpio_probe(struct pci_dev *pdev, ...@@ -425,7 +425,7 @@ static int intel_gpio_probe(struct pci_dev *pdev,
priv->chip.to_irq = intel_gpio_to_irq; priv->chip.to_irq = intel_gpio_to_irq;
priv->chip.base = gpio_base; priv->chip.base = gpio_base;
priv->chip.ngpio = ddata->ngpio; priv->chip.ngpio = ddata->ngpio;
priv->chip.can_sleep = 0; priv->chip.can_sleep = false;
priv->pdev = pdev; priv->pdev = pdev;
spin_lock_init(&priv->lock); spin_lock_init(&priv->lock);
......
...@@ -167,7 +167,7 @@ static int kempld_gpio_probe(struct platform_device *pdev) ...@@ -167,7 +167,7 @@ static int kempld_gpio_probe(struct platform_device *pdev)
chip->label = "gpio-kempld"; chip->label = "gpio-kempld";
chip->owner = THIS_MODULE; chip->owner = THIS_MODULE;
chip->dev = dev; chip->dev = dev;
chip->can_sleep = 1; chip->can_sleep = true;
if (pdata && pdata->gpio_base) if (pdata && pdata->gpio_base)
chip->base = pdata->gpio_base; chip->base = pdata->gpio_base;
else else
......
...@@ -228,7 +228,7 @@ static struct gpio_chip ks8695_gpio_chip = { ...@@ -228,7 +228,7 @@ static struct gpio_chip ks8695_gpio_chip = {
.to_irq = ks8695_gpio_to_irq, .to_irq = ks8695_gpio_to_irq,
.base = 0, .base = 0,
.ngpio = 16, .ngpio = 16,
.can_sleep = 0, .can_sleep = false,
}; };
/* Register the GPIOs */ /* Register the GPIOs */
......
...@@ -448,7 +448,7 @@ static struct lpc32xx_gpio_chip lpc32xx_gpiochip[] = { ...@@ -448,7 +448,7 @@ static struct lpc32xx_gpio_chip lpc32xx_gpiochip[] = {
.base = LPC32XX_GPIO_P0_GRP, .base = LPC32XX_GPIO_P0_GRP,
.ngpio = LPC32XX_GPIO_P0_MAX, .ngpio = LPC32XX_GPIO_P0_MAX,
.names = gpio_p0_names, .names = gpio_p0_names,
.can_sleep = 0, .can_sleep = false,
}, },
.gpio_grp = &gpio_grp_regs_p0, .gpio_grp = &gpio_grp_regs_p0,
}, },
...@@ -464,7 +464,7 @@ static struct lpc32xx_gpio_chip lpc32xx_gpiochip[] = { ...@@ -464,7 +464,7 @@ static struct lpc32xx_gpio_chip lpc32xx_gpiochip[] = {
.base = LPC32XX_GPIO_P1_GRP, .base = LPC32XX_GPIO_P1_GRP,
.ngpio = LPC32XX_GPIO_P1_MAX, .ngpio = LPC32XX_GPIO_P1_MAX,
.names = gpio_p1_names, .names = gpio_p1_names,
.can_sleep = 0, .can_sleep = false,
}, },
.gpio_grp = &gpio_grp_regs_p1, .gpio_grp = &gpio_grp_regs_p1,
}, },
...@@ -479,7 +479,7 @@ static struct lpc32xx_gpio_chip lpc32xx_gpiochip[] = { ...@@ -479,7 +479,7 @@ static struct lpc32xx_gpio_chip lpc32xx_gpiochip[] = {
.base = LPC32XX_GPIO_P2_GRP, .base = LPC32XX_GPIO_P2_GRP,
.ngpio = LPC32XX_GPIO_P2_MAX, .ngpio = LPC32XX_GPIO_P2_MAX,
.names = gpio_p2_names, .names = gpio_p2_names,
.can_sleep = 0, .can_sleep = false,
}, },
.gpio_grp = &gpio_grp_regs_p2, .gpio_grp = &gpio_grp_regs_p2,
}, },
...@@ -495,7 +495,7 @@ static struct lpc32xx_gpio_chip lpc32xx_gpiochip[] = { ...@@ -495,7 +495,7 @@ static struct lpc32xx_gpio_chip lpc32xx_gpiochip[] = {
.base = LPC32XX_GPIO_P3_GRP, .base = LPC32XX_GPIO_P3_GRP,
.ngpio = LPC32XX_GPIO_P3_MAX, .ngpio = LPC32XX_GPIO_P3_MAX,
.names = gpio_p3_names, .names = gpio_p3_names,
.can_sleep = 0, .can_sleep = false,
}, },
.gpio_grp = &gpio_grp_regs_p3, .gpio_grp = &gpio_grp_regs_p3,
}, },
...@@ -509,7 +509,7 @@ static struct lpc32xx_gpio_chip lpc32xx_gpiochip[] = { ...@@ -509,7 +509,7 @@ static struct lpc32xx_gpio_chip lpc32xx_gpiochip[] = {
.base = LPC32XX_GPI_P3_GRP, .base = LPC32XX_GPI_P3_GRP,
.ngpio = LPC32XX_GPI_P3_MAX, .ngpio = LPC32XX_GPI_P3_MAX,
.names = gpi_p3_names, .names = gpi_p3_names,
.can_sleep = 0, .can_sleep = false,
}, },
.gpio_grp = &gpio_grp_regs_p3, .gpio_grp = &gpio_grp_regs_p3,
}, },
...@@ -523,7 +523,7 @@ static struct lpc32xx_gpio_chip lpc32xx_gpiochip[] = { ...@@ -523,7 +523,7 @@ static struct lpc32xx_gpio_chip lpc32xx_gpiochip[] = {
.base = LPC32XX_GPO_P3_GRP, .base = LPC32XX_GPO_P3_GRP,
.ngpio = LPC32XX_GPO_P3_MAX, .ngpio = LPC32XX_GPO_P3_MAX,
.names = gpo_p3_names, .names = gpo_p3_names,
.can_sleep = 0, .can_sleep = false,
}, },
.gpio_grp = &gpio_grp_regs_p3, .gpio_grp = &gpio_grp_regs_p3,
}, },
......
...@@ -391,7 +391,7 @@ static int lp_gpio_probe(struct platform_device *pdev) ...@@ -391,7 +391,7 @@ static int lp_gpio_probe(struct platform_device *pdev)
gc->set = lp_gpio_set; gc->set = lp_gpio_set;
gc->base = -1; gc->base = -1;
gc->ngpio = LP_NUM_GPIO; gc->ngpio = LP_NUM_GPIO;
gc->can_sleep = 0; gc->can_sleep = false;
gc->dev = dev; gc->dev = dev;
/* set up interrupts */ /* set up interrupts */
......
...@@ -188,7 +188,7 @@ int __max730x_probe(struct max7301 *ts) ...@@ -188,7 +188,7 @@ int __max730x_probe(struct max7301 *ts)
ts->chip.set = max7301_set; ts->chip.set = max7301_set;
ts->chip.ngpio = PIN_NUMBER; ts->chip.ngpio = PIN_NUMBER;
ts->chip.can_sleep = 1; ts->chip.can_sleep = true;
ts->chip.dev = dev; ts->chip.dev = dev;
ts->chip.owner = THIS_MODULE; ts->chip.owner = THIS_MODULE;
......
...@@ -564,7 +564,7 @@ static int max732x_setup_gpio(struct max732x_chip *chip, ...@@ -564,7 +564,7 @@ static int max732x_setup_gpio(struct max732x_chip *chip,
gc->set = max732x_gpio_set_value; gc->set = max732x_gpio_set_value;
} }
gc->get = max732x_gpio_get_value; gc->get = max732x_gpio_get_value;
gc->can_sleep = 1; gc->can_sleep = true;
gc->base = gpio_start; gc->base = gpio_start;
gc->ngpio = port; gc->ngpio = port;
......
...@@ -115,7 +115,7 @@ static int mc33880_probe(struct spi_device *spi) ...@@ -115,7 +115,7 @@ static int mc33880_probe(struct spi_device *spi)
mc->chip.set = mc33880_set; mc->chip.set = mc33880_set;
mc->chip.base = pdata->base; mc->chip.base = pdata->base;
mc->chip.ngpio = PIN_NUMBER; mc->chip.ngpio = PIN_NUMBER;
mc->chip.can_sleep = 1; mc->chip.can_sleep = true;
mc->chip.dev = &spi->dev; mc->chip.dev = &spi->dev;
mc->chip.owner = THIS_MODULE; mc->chip.owner = THIS_MODULE;
......
...@@ -102,7 +102,7 @@ static int mc9s08dz60_probe(struct i2c_client *client, ...@@ -102,7 +102,7 @@ static int mc9s08dz60_probe(struct i2c_client *client,
mc9s->chip.dev = &client->dev; mc9s->chip.dev = &client->dev;
mc9s->chip.owner = THIS_MODULE; mc9s->chip.owner = THIS_MODULE;
mc9s->chip.ngpio = GPIO_NUM; mc9s->chip.ngpio = GPIO_NUM;
mc9s->chip.can_sleep = 1; mc9s->chip.can_sleep = true;
mc9s->chip.get = mc9s08dz60_get_value; mc9s->chip.get = mc9s08dz60_get_value;
mc9s->chip.set = mc9s08dz60_set_value; mc9s->chip.set = mc9s08dz60_set_value;
mc9s->chip.direction_output = mc9s08dz60_direction_output; mc9s->chip.direction_output = mc9s08dz60_direction_output;
......
...@@ -425,7 +425,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev, ...@@ -425,7 +425,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
} }
mcp->chip.base = base; mcp->chip.base = base;
mcp->chip.can_sleep = 1; mcp->chip.can_sleep = true;
mcp->chip.dev = dev; mcp->chip.dev = dev;
mcp->chip.owner = THIS_MODULE; mcp->chip.owner = THIS_MODULE;
......
...@@ -242,7 +242,7 @@ static void ioh_gpio_setup(struct ioh_gpio *chip, int num_port) ...@@ -242,7 +242,7 @@ static void ioh_gpio_setup(struct ioh_gpio *chip, int num_port)
gpio->dbg_show = NULL; gpio->dbg_show = NULL;
gpio->base = -1; gpio->base = -1;
gpio->ngpio = num_port; gpio->ngpio = num_port;
gpio->can_sleep = 0; gpio->can_sleep = false;
gpio->to_irq = ioh_gpio_to_irq; gpio->to_irq = ioh_gpio_to_irq;
} }
......
...@@ -292,7 +292,7 @@ static int platform_msic_gpio_probe(struct platform_device *pdev) ...@@ -292,7 +292,7 @@ static int platform_msic_gpio_probe(struct platform_device *pdev)
mg->chip.to_irq = msic_gpio_to_irq; mg->chip.to_irq = msic_gpio_to_irq;
mg->chip.base = pdata->gpio_base; mg->chip.base = pdata->gpio_base;
mg->chip.ngpio = MSIC_NUM_GPIO; mg->chip.ngpio = MSIC_NUM_GPIO;
mg->chip.can_sleep = 1; mg->chip.can_sleep = true;
mg->chip.dev = dev; mg->chip.dev = dev;
mutex_init(&mg->buslock); mutex_init(&mg->buslock);
......
...@@ -600,7 +600,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev) ...@@ -600,7 +600,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
mvchip->chip.to_irq = mvebu_gpio_to_irq; mvchip->chip.to_irq = mvebu_gpio_to_irq;
mvchip->chip.base = id * MVEBU_MAX_GPIO_PER_BANK; mvchip->chip.base = id * MVEBU_MAX_GPIO_PER_BANK;
mvchip->chip.ngpio = ngpios; mvchip->chip.ngpio = ngpios;
mvchip->chip.can_sleep = 0; mvchip->chip.can_sleep = false;
mvchip->chip.of_node = np; mvchip->chip.of_node = np;
mvchip->chip.dbg_show = mvebu_gpio_dbg_show; mvchip->chip.dbg_show = mvebu_gpio_dbg_show;
......
...@@ -111,7 +111,7 @@ static int octeon_gpio_probe(struct platform_device *pdev) ...@@ -111,7 +111,7 @@ static int octeon_gpio_probe(struct platform_device *pdev)
chip->dev = &pdev->dev; chip->dev = &pdev->dev;
chip->owner = THIS_MODULE; chip->owner = THIS_MODULE;
chip->base = 0; chip->base = 0;
chip->can_sleep = 0; chip->can_sleep = false;
chip->ngpio = 20; chip->ngpio = 20;
chip->direction_input = octeon_gpio_dir_in; chip->direction_input = octeon_gpio_dir_in;
chip->get = octeon_gpio_get; chip->get = octeon_gpio_get;
......
...@@ -182,7 +182,7 @@ static int palmas_gpio_probe(struct platform_device *pdev) ...@@ -182,7 +182,7 @@ static int palmas_gpio_probe(struct platform_device *pdev)
palmas_gpio->gpio_chip.owner = THIS_MODULE; palmas_gpio->gpio_chip.owner = THIS_MODULE;
palmas_gpio->gpio_chip.label = dev_name(&pdev->dev); palmas_gpio->gpio_chip.label = dev_name(&pdev->dev);
palmas_gpio->gpio_chip.ngpio = dev_data->ngpio; palmas_gpio->gpio_chip.ngpio = dev_data->ngpio;
palmas_gpio->gpio_chip.can_sleep = 1; palmas_gpio->gpio_chip.can_sleep = true;
palmas_gpio->gpio_chip.direction_input = palmas_gpio_input; palmas_gpio->gpio_chip.direction_input = palmas_gpio_input;
palmas_gpio->gpio_chip.direction_output = palmas_gpio_output; palmas_gpio->gpio_chip.direction_output = palmas_gpio_output;
palmas_gpio->gpio_chip.to_irq = palmas_gpio_to_irq; palmas_gpio->gpio_chip.to_irq = palmas_gpio_to_irq;
......
...@@ -354,7 +354,7 @@ static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios) ...@@ -354,7 +354,7 @@ static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios)
gc->direction_output = pca953x_gpio_direction_output; gc->direction_output = pca953x_gpio_direction_output;
gc->get = pca953x_gpio_get_value; gc->get = pca953x_gpio_get_value;
gc->set = pca953x_gpio_set_value; gc->set = pca953x_gpio_set_value;
gc->can_sleep = 1; gc->can_sleep = true;
gc->base = chip->gpio_start; gc->base = chip->gpio_start;
gc->ngpio = gpios; gc->ngpio = gpios;
......
...@@ -305,7 +305,7 @@ static int pcf857x_probe(struct i2c_client *client, ...@@ -305,7 +305,7 @@ static int pcf857x_probe(struct i2c_client *client,
spin_lock_init(&gpio->slock); spin_lock_init(&gpio->slock);
gpio->chip.base = pdata ? pdata->gpio_base : -1; gpio->chip.base = pdata ? pdata->gpio_base : -1;
gpio->chip.can_sleep = 1; gpio->chip.can_sleep = true;
gpio->chip.dev = &client->dev; gpio->chip.dev = &client->dev;
gpio->chip.owner = THIS_MODULE; gpio->chip.owner = THIS_MODULE;
gpio->chip.get = pcf857x_get; gpio->chip.get = pcf857x_get;
......
...@@ -224,7 +224,7 @@ static void pch_gpio_setup(struct pch_gpio *chip) ...@@ -224,7 +224,7 @@ static void pch_gpio_setup(struct pch_gpio *chip)
gpio->dbg_show = NULL; gpio->dbg_show = NULL;
gpio->base = -1; gpio->base = -1;
gpio->ngpio = gpio_pins[chip->ioh]; gpio->ngpio = gpio_pins[chip->ioh];
gpio->can_sleep = 0; gpio->can_sleep = false;
gpio->to_irq = pch_gpio_to_irq; gpio->to_irq = pch_gpio_to_irq;
} }
......
...@@ -133,7 +133,7 @@ static int rc5t583_gpio_probe(struct platform_device *pdev) ...@@ -133,7 +133,7 @@ static int rc5t583_gpio_probe(struct platform_device *pdev)
rc5t583_gpio->gpio_chip.get = rc5t583_gpio_get, rc5t583_gpio->gpio_chip.get = rc5t583_gpio_get,
rc5t583_gpio->gpio_chip.to_irq = rc5t583_gpio_to_irq, rc5t583_gpio->gpio_chip.to_irq = rc5t583_gpio_to_irq,
rc5t583_gpio->gpio_chip.ngpio = RC5T583_MAX_GPIO, rc5t583_gpio->gpio_chip.ngpio = RC5T583_MAX_GPIO,
rc5t583_gpio->gpio_chip.can_sleep = 1, rc5t583_gpio->gpio_chip.can_sleep = true,
rc5t583_gpio->gpio_chip.dev = &pdev->dev; rc5t583_gpio->gpio_chip.dev = &pdev->dev;
rc5t583_gpio->gpio_chip.base = -1; rc5t583_gpio->gpio_chip.base = -1;
rc5t583_gpio->rc5t583 = rc5t583; rc5t583_gpio->rc5t583 = rc5t583;
......
...@@ -146,7 +146,7 @@ static void gsta_gpio_setup(struct gsta_gpio *chip) /* called from probe */ ...@@ -146,7 +146,7 @@ static void gsta_gpio_setup(struct gsta_gpio *chip) /* called from probe */
gpio->dbg_show = NULL; gpio->dbg_show = NULL;
gpio->base = gpio_base; gpio->base = gpio_base;
gpio->ngpio = GSTA_NR_GPIO; gpio->ngpio = GSTA_NR_GPIO;
gpio->can_sleep = 0; gpio->can_sleep = false;
gpio->to_irq = gsta_gpio_to_irq; gpio->to_irq = gsta_gpio_to_irq;
/* /*
......
...@@ -129,7 +129,7 @@ static struct gpio_chip template_chip = { ...@@ -129,7 +129,7 @@ static struct gpio_chip template_chip = {
.set = stmpe_gpio_set, .set = stmpe_gpio_set,
.to_irq = stmpe_gpio_to_irq, .to_irq = stmpe_gpio_to_irq,
.request = stmpe_gpio_request, .request = stmpe_gpio_request,
.can_sleep = 1, .can_sleep = true,
}; };
static int stmpe_gpio_irq_set_type(struct irq_data *d, unsigned int type) static int stmpe_gpio_irq_set_type(struct irq_data *d, unsigned int type)
......
...@@ -436,7 +436,7 @@ static void sx150x_init_chip(struct sx150x_chip *chip, ...@@ -436,7 +436,7 @@ static void sx150x_init_chip(struct sx150x_chip *chip,
chip->gpio_chip.set = sx150x_gpio_set; chip->gpio_chip.set = sx150x_gpio_set;
chip->gpio_chip.to_irq = sx150x_gpio_to_irq; chip->gpio_chip.to_irq = sx150x_gpio_to_irq;
chip->gpio_chip.base = pdata->gpio_base; chip->gpio_chip.base = pdata->gpio_base;
chip->gpio_chip.can_sleep = 1; chip->gpio_chip.can_sleep = true;
chip->gpio_chip.ngpio = chip->dev_cfg->ngpios; chip->gpio_chip.ngpio = chip->dev_cfg->ngpios;
if (pdata->oscio_is_gpo) if (pdata->oscio_is_gpo)
++chip->gpio_chip.ngpio; ++chip->gpio_chip.ngpio;
......
...@@ -221,7 +221,7 @@ static int tb10x_gpio_probe(struct platform_device *pdev) ...@@ -221,7 +221,7 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
tb10x_gpio->gc.free = tb10x_gpio_free; tb10x_gpio->gc.free = tb10x_gpio_free;
tb10x_gpio->gc.base = -1; tb10x_gpio->gc.base = -1;
tb10x_gpio->gc.ngpio = ngpio; tb10x_gpio->gc.ngpio = ngpio;
tb10x_gpio->gc.can_sleep = 0; tb10x_gpio->gc.can_sleep = false;
ret = gpiochip_add(&tb10x_gpio->gc); ret = gpiochip_add(&tb10x_gpio->gc);
......
...@@ -127,7 +127,7 @@ static struct gpio_chip template_chip = { ...@@ -127,7 +127,7 @@ static struct gpio_chip template_chip = {
.direction_output = tc3589x_gpio_direction_output, .direction_output = tc3589x_gpio_direction_output,
.set = tc3589x_gpio_set, .set = tc3589x_gpio_set,
.to_irq = tc3589x_gpio_to_irq, .to_irq = tc3589x_gpio_to_irq,
.can_sleep = 1, .can_sleep = true,
}; };
static int tc3589x_gpio_irq_set_type(struct irq_data *d, unsigned int type) static int tc3589x_gpio_irq_set_type(struct irq_data *d, unsigned int type)
......
...@@ -275,7 +275,7 @@ static int timbgpio_probe(struct platform_device *pdev) ...@@ -275,7 +275,7 @@ static int timbgpio_probe(struct platform_device *pdev)
gc->dbg_show = NULL; gc->dbg_show = NULL;
gc->base = pdata->gpio_base; gc->base = pdata->gpio_base;
gc->ngpio = pdata->nr_pins; gc->ngpio = pdata->nr_pins;
gc->can_sleep = 0; gc->can_sleep = false;
err = gpiochip_add(gc); err = gpiochip_add(gc);
if (err) if (err)
......
...@@ -176,7 +176,7 @@ static int __init tnetv107x_gpio_setup(void) ...@@ -176,7 +176,7 @@ static int __init tnetv107x_gpio_setup(void)
ctlr = &chips[i]; ctlr = &chips[i];
ctlr->chip.label = "tnetv107x"; ctlr->chip.label = "tnetv107x";
ctlr->chip.can_sleep = 0; ctlr->chip.can_sleep = false;
ctlr->chip.base = base; ctlr->chip.base = base;
ctlr->chip.ngpio = ngpio - base; ctlr->chip.ngpio = ngpio - base;
if (ctlr->chip.ngpio > 32) if (ctlr->chip.ngpio > 32)
......
...@@ -108,7 +108,7 @@ static int tps6586x_gpio_probe(struct platform_device *pdev) ...@@ -108,7 +108,7 @@ static int tps6586x_gpio_probe(struct platform_device *pdev)
tps6586x_gpio->gpio_chip.label = pdev->name; tps6586x_gpio->gpio_chip.label = pdev->name;
tps6586x_gpio->gpio_chip.dev = &pdev->dev; tps6586x_gpio->gpio_chip.dev = &pdev->dev;
tps6586x_gpio->gpio_chip.ngpio = 4; tps6586x_gpio->gpio_chip.ngpio = 4;
tps6586x_gpio->gpio_chip.can_sleep = 1; tps6586x_gpio->gpio_chip.can_sleep = true;
/* FIXME: add handling of GPIOs as dedicated inputs */ /* FIXME: add handling of GPIOs as dedicated inputs */
tps6586x_gpio->gpio_chip.direction_output = tps6586x_gpio_output; tps6586x_gpio->gpio_chip.direction_output = tps6586x_gpio_output;
......
...@@ -143,7 +143,7 @@ static int tps65910_gpio_probe(struct platform_device *pdev) ...@@ -143,7 +143,7 @@ static int tps65910_gpio_probe(struct platform_device *pdev)
default: default:
return -EINVAL; return -EINVAL;
} }
tps65910_gpio->gpio_chip.can_sleep = 1; tps65910_gpio->gpio_chip.can_sleep = true;
tps65910_gpio->gpio_chip.direction_input = tps65910_gpio_input; tps65910_gpio->gpio_chip.direction_input = tps65910_gpio_input;
tps65910_gpio->gpio_chip.direction_output = tps65910_gpio_output; tps65910_gpio->gpio_chip.direction_output = tps65910_gpio_output;
tps65910_gpio->gpio_chip.set = tps65910_gpio_set; tps65910_gpio->gpio_chip.set = tps65910_gpio_set;
......
...@@ -79,7 +79,7 @@ static struct gpio_chip template_chip = { ...@@ -79,7 +79,7 @@ static struct gpio_chip template_chip = {
.direction_output = tps65912_gpio_output, .direction_output = tps65912_gpio_output,
.get = tps65912_gpio_get, .get = tps65912_gpio_get,
.set = tps65912_gpio_set, .set = tps65912_gpio_set,
.can_sleep = 1, .can_sleep = true,
.ngpio = 5, .ngpio = 5,
.base = -1, .base = -1,
}; };
......
...@@ -386,7 +386,7 @@ static struct gpio_chip template_chip = { ...@@ -386,7 +386,7 @@ static struct gpio_chip template_chip = {
.direction_output = twl_direction_out, .direction_output = twl_direction_out,
.set = twl_set, .set = twl_set,
.to_irq = twl_to_irq, .to_irq = twl_to_irq,
.can_sleep = 1, .can_sleep = true,
}; };
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
......
...@@ -77,7 +77,7 @@ static struct gpio_chip twl6040gpo_chip = { ...@@ -77,7 +77,7 @@ static struct gpio_chip twl6040gpo_chip = {
.get = twl6040gpo_get, .get = twl6040gpo_get,
.direction_output = twl6040gpo_direction_out, .direction_output = twl6040gpo_direction_out,
.set = twl6040gpo_set, .set = twl6040gpo_set,
.can_sleep = 1, .can_sleep = true,
}; };
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
......
...@@ -64,7 +64,7 @@ static int ucb1400_gpio_probe(struct platform_device *dev) ...@@ -64,7 +64,7 @@ static int ucb1400_gpio_probe(struct platform_device *dev)
ucb->gc.direction_output = ucb1400_gpio_dir_out; ucb->gc.direction_output = ucb1400_gpio_dir_out;
ucb->gc.get = ucb1400_gpio_get; ucb->gc.get = ucb1400_gpio_get;
ucb->gc.set = ucb1400_gpio_set; ucb->gc.set = ucb1400_gpio_set;
ucb->gc.can_sleep = 1; ucb->gc.can_sleep = true;
err = gpiochip_add(&ucb->gc); err = gpiochip_add(&ucb->gc);
if (err) if (err)
......
...@@ -413,7 +413,7 @@ static int vprbrd_gpio_probe(struct platform_device *pdev) ...@@ -413,7 +413,7 @@ static int vprbrd_gpio_probe(struct platform_device *pdev)
vb_gpio->gpioa.owner = THIS_MODULE; vb_gpio->gpioa.owner = THIS_MODULE;
vb_gpio->gpioa.base = -1; vb_gpio->gpioa.base = -1;
vb_gpio->gpioa.ngpio = 16; vb_gpio->gpioa.ngpio = 16;
vb_gpio->gpioa.can_sleep = 1; vb_gpio->gpioa.can_sleep = true;
vb_gpio->gpioa.set = vprbrd_gpioa_set; vb_gpio->gpioa.set = vprbrd_gpioa_set;
vb_gpio->gpioa.get = vprbrd_gpioa_get; vb_gpio->gpioa.get = vprbrd_gpioa_get;
vb_gpio->gpioa.direction_input = vprbrd_gpioa_direction_input; vb_gpio->gpioa.direction_input = vprbrd_gpioa_direction_input;
...@@ -430,7 +430,7 @@ static int vprbrd_gpio_probe(struct platform_device *pdev) ...@@ -430,7 +430,7 @@ static int vprbrd_gpio_probe(struct platform_device *pdev)
vb_gpio->gpiob.owner = THIS_MODULE; vb_gpio->gpiob.owner = THIS_MODULE;
vb_gpio->gpiob.base = -1; vb_gpio->gpiob.base = -1;
vb_gpio->gpiob.ngpio = 16; vb_gpio->gpiob.ngpio = 16;
vb_gpio->gpiob.can_sleep = 1; vb_gpio->gpiob.can_sleep = true;
vb_gpio->gpiob.set = vprbrd_gpiob_set; vb_gpio->gpiob.set = vprbrd_gpiob_set;
vb_gpio->gpiob.get = vprbrd_gpiob_get; vb_gpio->gpiob.get = vprbrd_gpiob_get;
vb_gpio->gpiob.direction_input = vprbrd_gpiob_direction_input; vb_gpio->gpiob.direction_input = vprbrd_gpiob_direction_input;
......
...@@ -214,7 +214,7 @@ static void vx855gpio_gpio_setup(struct vx855_gpio *vg) ...@@ -214,7 +214,7 @@ static void vx855gpio_gpio_setup(struct vx855_gpio *vg)
c->dbg_show = NULL; c->dbg_show = NULL;
c->base = 0; c->base = 0;
c->ngpio = NR_VX855_GP; c->ngpio = NR_VX855_GP;
c->can_sleep = 0; c->can_sleep = false;
c->names = vx855gpio_names; c->names = vx855gpio_names;
} }
......
...@@ -240,7 +240,7 @@ static struct gpio_chip template_chip = { ...@@ -240,7 +240,7 @@ static struct gpio_chip template_chip = {
.to_irq = wm831x_gpio_to_irq, .to_irq = wm831x_gpio_to_irq,
.set_debounce = wm831x_gpio_set_debounce, .set_debounce = wm831x_gpio_set_debounce,
.dbg_show = wm831x_gpio_dbg_show, .dbg_show = wm831x_gpio_dbg_show,
.can_sleep = 1, .can_sleep = true,
}; };
static int wm831x_gpio_probe(struct platform_device *pdev) static int wm831x_gpio_probe(struct platform_device *pdev)
......
...@@ -106,7 +106,7 @@ static struct gpio_chip template_chip = { ...@@ -106,7 +106,7 @@ static struct gpio_chip template_chip = {
.direction_output = wm8350_gpio_direction_out, .direction_output = wm8350_gpio_direction_out,
.set = wm8350_gpio_set, .set = wm8350_gpio_set,
.to_irq = wm8350_gpio_to_irq, .to_irq = wm8350_gpio_to_irq,
.can_sleep = 1, .can_sleep = true,
}; };
static int wm8350_gpio_probe(struct platform_device *pdev) static int wm8350_gpio_probe(struct platform_device *pdev)
......
...@@ -242,7 +242,7 @@ static struct gpio_chip template_chip = { ...@@ -242,7 +242,7 @@ static struct gpio_chip template_chip = {
.set = wm8994_gpio_set, .set = wm8994_gpio_set,
.to_irq = wm8994_gpio_to_irq, .to_irq = wm8994_gpio_to_irq,
.dbg_show = wm8994_gpio_dbg_show, .dbg_show = wm8994_gpio_dbg_show,
.can_sleep = 1, .can_sleep = true,
}; };
static int wm8994_gpio_probe(struct platform_device *pdev) static int wm8994_gpio_probe(struct platform_device *pdev)
......
...@@ -1051,7 +1051,7 @@ static void gpiochip_unexport(struct gpio_chip *chip) ...@@ -1051,7 +1051,7 @@ static void gpiochip_unexport(struct gpio_chip *chip)
if (dev) { if (dev) {
put_device(dev); put_device(dev);
device_unregister(dev); device_unregister(dev);
chip->exported = 0; chip->exported = false;
status = 0; status = 0;
} else } else
status = -ENODEV; status = -ENODEV;
......
...@@ -531,7 +531,7 @@ static const struct gpio_chip as3722_gpio_chip = { ...@@ -531,7 +531,7 @@ static const struct gpio_chip as3722_gpio_chip = {
.direction_input = as3722_gpio_direction_input, .direction_input = as3722_gpio_direction_input,
.direction_output = as3722_gpio_direction_output, .direction_output = as3722_gpio_direction_output,
.to_irq = as3722_gpio_to_irq, .to_irq = as3722_gpio_to_irq,
.can_sleep = 1, .can_sleep = true,
.ngpio = AS3722_PIN_NUM, .ngpio = AS3722_PIN_NUM,
.base = -1, .base = -1,
}; };
......
...@@ -1527,7 +1527,7 @@ static struct gpio_chip at91_gpio_template = { ...@@ -1527,7 +1527,7 @@ static struct gpio_chip at91_gpio_template = {
.set = at91_gpio_set, .set = at91_gpio_set,
.to_irq = at91_gpio_to_irq, .to_irq = at91_gpio_to_irq,
.dbg_show = at91_gpio_dbg_show, .dbg_show = at91_gpio_dbg_show,
.can_sleep = 0, .can_sleep = false,
.ngpio = MAX_NB_GPIO_PER_BANK, .ngpio = MAX_NB_GPIO_PER_BANK,
}; };
......
...@@ -461,7 +461,7 @@ static int byt_gpio_probe(struct platform_device *pdev) ...@@ -461,7 +461,7 @@ static int byt_gpio_probe(struct platform_device *pdev)
gc->set = byt_gpio_set; gc->set = byt_gpio_set;
gc->dbg_show = byt_gpio_dbg_show; gc->dbg_show = byt_gpio_dbg_show;
gc->base = -1; gc->base = -1;
gc->can_sleep = 0; gc->can_sleep = false;
gc->dev = dev; gc->dev = dev;
ret = gpiochip_add(gc); ret = gpiochip_add(gc);
......
...@@ -384,7 +384,7 @@ static struct gpio_chip bcm2835_gpio_chip = { ...@@ -384,7 +384,7 @@ static struct gpio_chip bcm2835_gpio_chip = {
.to_irq = bcm2835_gpio_to_irq, .to_irq = bcm2835_gpio_to_irq,
.base = -1, .base = -1,
.ngpio = BCM2835_NUM_GPIOS, .ngpio = BCM2835_NUM_GPIOS,
.can_sleep = 0, .can_sleep = false,
}; };
static irqreturn_t bcm2835_gpio_irq_handler(int irq, void *dev_id) static irqreturn_t bcm2835_gpio_irq_handler(int irq, void *dev_id)
......
...@@ -904,7 +904,7 @@ static struct gpio_chip nmk_gpio_template = { ...@@ -904,7 +904,7 @@ static struct gpio_chip nmk_gpio_template = {
.set = nmk_gpio_set_output, .set = nmk_gpio_set_output,
.to_irq = nmk_gpio_to_irq, .to_irq = nmk_gpio_to_irq,
.dbg_show = nmk_gpio_dbg_show, .dbg_show = nmk_gpio_dbg_show,
.can_sleep = 0, .can_sleep = false,
}; };
void nmk_gpio_clocks_enable(void) void nmk_gpio_clocks_enable(void)
......
...@@ -547,7 +547,7 @@ static struct gpio_chip sunxi_pinctrl_gpio_chip = { ...@@ -547,7 +547,7 @@ static struct gpio_chip sunxi_pinctrl_gpio_chip = {
.of_xlate = sunxi_pinctrl_gpio_of_xlate, .of_xlate = sunxi_pinctrl_gpio_of_xlate,
.to_irq = sunxi_pinctrl_gpio_to_irq, .to_irq = sunxi_pinctrl_gpio_to_irq,
.of_gpio_n_cells = 3, .of_gpio_n_cells = 3,
.can_sleep = 0, .can_sleep = false,
}; };
static int sunxi_pinctrl_irq_set_type(struct irq_data *d, static int sunxi_pinctrl_irq_set_type(struct irq_data *d,
......
...@@ -565,7 +565,7 @@ static struct gpio_chip wmt_gpio_chip = { ...@@ -565,7 +565,7 @@ static struct gpio_chip wmt_gpio_chip = {
.direction_output = wmt_gpio_direction_output, .direction_output = wmt_gpio_direction_output,
.get = wmt_gpio_get_value, .get = wmt_gpio_get_value,
.set = wmt_gpio_set_value, .set = wmt_gpio_set_value,
.can_sleep = 0, .can_sleep = false,
}; };
int wmt_pinctrl_probe(struct platform_device *pdev, int wmt_pinctrl_probe(struct platform_device *pdev,
......
...@@ -36,14 +36,15 @@ struct seq_file; ...@@ -36,14 +36,15 @@ struct seq_file;
* @ngpio: the number of GPIOs handled by this controller; the last GPIO * @ngpio: the number of GPIOs handled by this controller; the last GPIO
* handled is (base + ngpio - 1). * handled is (base + ngpio - 1).
* @desc: array of ngpio descriptors. Private. * @desc: array of ngpio descriptors. Private.
* @can_sleep: flag must be set iff get()/set() methods sleep, as they
* must while accessing GPIO expander chips over I2C or SPI
* @names: if set, must be an array of strings to use as alternative * @names: if set, must be an array of strings to use as alternative
* names for the GPIOs in this chip. Any entry in the array * names for the GPIOs in this chip. Any entry in the array
* may be NULL if there is no alias for the GPIO, however the * may be NULL if there is no alias for the GPIO, however the
* array must be @ngpio entries long. A name can include a single printk * array must be @ngpio entries long. A name can include a single printk
* format specifier for an unsigned int. It is substituted by the actual * format specifier for an unsigned int. It is substituted by the actual
* number of the gpio. * number of the gpio.
* @can_sleep: flag must be set iff get()/set() methods sleep, as they
* must while accessing GPIO expander chips over I2C or SPI
* @exported: flags if the gpiochip is exported for use from sysfs. Private.
* *
* A gpio_chip can help platforms abstract various sources of GPIOs so * A gpio_chip can help platforms abstract various sources of GPIOs so
* they can all be accessed through a common programing interface. * they can all be accessed through a common programing interface.
...@@ -88,8 +89,8 @@ struct gpio_chip { ...@@ -88,8 +89,8 @@ struct gpio_chip {
u16 ngpio; u16 ngpio;
struct gpio_desc *desc; struct gpio_desc *desc;
const char *const *names; const char *const *names;
unsigned can_sleep:1; bool can_sleep;
unsigned exported:1; bool exported;
#if defined(CONFIG_OF_GPIO) #if defined(CONFIG_OF_GPIO)
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment