Loading Documentation/devicetree/bindings/mfd/bd9571mwv.txt +2 −2 Original line number Diff line number Diff line * ROHM BD9571MWV Power Management Integrated Circuit (PMIC) bindings * ROHM BD9571MWV/BD9574MWF Power Management Integrated Circuit (PMIC) bindings Required properties: - compatible : Should be "rohm,bd9571mwv". - compatible : Should be "rohm,bd9571mwv" or "rohm,bd9574mwf". - reg : I2C slave address. - interrupts : The interrupt line the device is connected to. - interrupt-controller : Marks the device node as an interrupt controller. Loading drivers/bus/sunxi-rsb.c +3 −1 Original line number Diff line number Diff line Loading @@ -170,7 +170,9 @@ static int sunxi_rsb_device_remove(struct device *dev) { const struct sunxi_rsb_driver *drv = to_sunxi_rsb_driver(dev->driver); return drv->remove(to_sunxi_rsb_device(dev)); drv->remove(to_sunxi_rsb_device(dev)); return 0; } static struct bus_type sunxi_rsb_bus = { Loading drivers/gpio/gpio-bd9571mwv.c +14 −21 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * ROHM BD9571MWV-M GPIO driver * ROHM BD9571MWV-M and BD9574MWF-M GPIO driver * * Copyright (C) 2017 Marek Vasut <marek.vasut+renesas@gmail.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed "as is" WITHOUT ANY WARRANTY of any * kind, whether expressed or implied; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License version 2 for more details. * * Based on the TPS65086 driver * * NOTE: Interrupts are not supported yet. */ #include <linux/gpio/driver.h> #include <linux/mfd/rohm-generic.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/mfd/bd9571mwv.h> struct bd9571mwv_gpio { struct regmap *regmap; struct gpio_chip chip; struct bd9571mwv *bd; }; static int bd9571mwv_gpio_get_direction(struct gpio_chip *chip, Loading @@ -34,7 +27,7 @@ static int bd9571mwv_gpio_get_direction(struct gpio_chip *chip, struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip); int ret, val; ret = regmap_read(gpio->bd->regmap, BD9571MWV_GPIO_DIR, &val); ret = regmap_read(gpio->regmap, BD9571MWV_GPIO_DIR, &val); if (ret < 0) return ret; if (val & BIT(offset)) Loading @@ -48,8 +41,7 @@ static int bd9571mwv_gpio_direction_input(struct gpio_chip *chip, { struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip); regmap_update_bits(gpio->bd->regmap, BD9571MWV_GPIO_DIR, BIT(offset), 0); regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_DIR, BIT(offset), 0); return 0; } Loading @@ -60,9 +52,9 @@ static int bd9571mwv_gpio_direction_output(struct gpio_chip *chip, struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip); /* Set the initial value */ regmap_update_bits(gpio->bd->regmap, BD9571MWV_GPIO_OUT, regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_OUT, BIT(offset), value ? BIT(offset) : 0); regmap_update_bits(gpio->bd->regmap, BD9571MWV_GPIO_DIR, regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_DIR, BIT(offset), BIT(offset)); return 0; Loading @@ -73,7 +65,7 @@ static int bd9571mwv_gpio_get(struct gpio_chip *chip, unsigned int offset) struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip); int ret, val; ret = regmap_read(gpio->bd->regmap, BD9571MWV_GPIO_IN, &val); ret = regmap_read(gpio->regmap, BD9571MWV_GPIO_IN, &val); if (ret < 0) return ret; Loading @@ -85,7 +77,7 @@ static void bd9571mwv_gpio_set(struct gpio_chip *chip, unsigned int offset, { struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip); regmap_update_bits(gpio->bd->regmap, BD9571MWV_GPIO_OUT, regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_OUT, BIT(offset), value ? BIT(offset) : 0); } Loading Loading @@ -113,9 +105,9 @@ static int bd9571mwv_gpio_probe(struct platform_device *pdev) platform_set_drvdata(pdev, gpio); gpio->bd = dev_get_drvdata(pdev->dev.parent); gpio->regmap = dev_get_regmap(pdev->dev.parent, NULL); gpio->chip = template_chip; gpio->chip.parent = gpio->bd->dev; gpio->chip.parent = pdev->dev.parent; ret = devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio); if (ret < 0) { Loading @@ -127,7 +119,8 @@ static int bd9571mwv_gpio_probe(struct platform_device *pdev) } static const struct platform_device_id bd9571mwv_gpio_id_table[] = { { "bd9571mwv-gpio", }, { "bd9571mwv-gpio", ROHM_CHIP_TYPE_BD9571 }, { "bd9574mwf-gpio", ROHM_CHIP_TYPE_BD9574 }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(platform, bd9571mwv_gpio_id_table); Loading drivers/mfd/axp20x-i2c.c +3 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,9 @@ static int axp20x_i2c_remove(struct i2c_client *i2c) { struct axp20x_dev *axp20x = i2c_get_clientdata(i2c); return axp20x_device_remove(axp20x); axp20x_device_remove(axp20x); return 0; } #ifdef CONFIG_OF Loading drivers/mfd/axp20x-rsb.c +2 −2 Original line number Diff line number Diff line Loading @@ -49,11 +49,11 @@ static int axp20x_rsb_probe(struct sunxi_rsb_device *rdev) return axp20x_device_probe(axp20x); } static int axp20x_rsb_remove(struct sunxi_rsb_device *rdev) static void axp20x_rsb_remove(struct sunxi_rsb_device *rdev) { struct axp20x_dev *axp20x = sunxi_rsb_device_get_drvdata(rdev); return axp20x_device_remove(axp20x); axp20x_device_remove(axp20x); } static const struct of_device_id axp20x_rsb_of_match[] = { Loading Loading
Documentation/devicetree/bindings/mfd/bd9571mwv.txt +2 −2 Original line number Diff line number Diff line * ROHM BD9571MWV Power Management Integrated Circuit (PMIC) bindings * ROHM BD9571MWV/BD9574MWF Power Management Integrated Circuit (PMIC) bindings Required properties: - compatible : Should be "rohm,bd9571mwv". - compatible : Should be "rohm,bd9571mwv" or "rohm,bd9574mwf". - reg : I2C slave address. - interrupts : The interrupt line the device is connected to. - interrupt-controller : Marks the device node as an interrupt controller. Loading
drivers/bus/sunxi-rsb.c +3 −1 Original line number Diff line number Diff line Loading @@ -170,7 +170,9 @@ static int sunxi_rsb_device_remove(struct device *dev) { const struct sunxi_rsb_driver *drv = to_sunxi_rsb_driver(dev->driver); return drv->remove(to_sunxi_rsb_device(dev)); drv->remove(to_sunxi_rsb_device(dev)); return 0; } static struct bus_type sunxi_rsb_bus = { Loading
drivers/gpio/gpio-bd9571mwv.c +14 −21 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * ROHM BD9571MWV-M GPIO driver * ROHM BD9571MWV-M and BD9574MWF-M GPIO driver * * Copyright (C) 2017 Marek Vasut <marek.vasut+renesas@gmail.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed "as is" WITHOUT ANY WARRANTY of any * kind, whether expressed or implied; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License version 2 for more details. * * Based on the TPS65086 driver * * NOTE: Interrupts are not supported yet. */ #include <linux/gpio/driver.h> #include <linux/mfd/rohm-generic.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/mfd/bd9571mwv.h> struct bd9571mwv_gpio { struct regmap *regmap; struct gpio_chip chip; struct bd9571mwv *bd; }; static int bd9571mwv_gpio_get_direction(struct gpio_chip *chip, Loading @@ -34,7 +27,7 @@ static int bd9571mwv_gpio_get_direction(struct gpio_chip *chip, struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip); int ret, val; ret = regmap_read(gpio->bd->regmap, BD9571MWV_GPIO_DIR, &val); ret = regmap_read(gpio->regmap, BD9571MWV_GPIO_DIR, &val); if (ret < 0) return ret; if (val & BIT(offset)) Loading @@ -48,8 +41,7 @@ static int bd9571mwv_gpio_direction_input(struct gpio_chip *chip, { struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip); regmap_update_bits(gpio->bd->regmap, BD9571MWV_GPIO_DIR, BIT(offset), 0); regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_DIR, BIT(offset), 0); return 0; } Loading @@ -60,9 +52,9 @@ static int bd9571mwv_gpio_direction_output(struct gpio_chip *chip, struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip); /* Set the initial value */ regmap_update_bits(gpio->bd->regmap, BD9571MWV_GPIO_OUT, regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_OUT, BIT(offset), value ? BIT(offset) : 0); regmap_update_bits(gpio->bd->regmap, BD9571MWV_GPIO_DIR, regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_DIR, BIT(offset), BIT(offset)); return 0; Loading @@ -73,7 +65,7 @@ static int bd9571mwv_gpio_get(struct gpio_chip *chip, unsigned int offset) struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip); int ret, val; ret = regmap_read(gpio->bd->regmap, BD9571MWV_GPIO_IN, &val); ret = regmap_read(gpio->regmap, BD9571MWV_GPIO_IN, &val); if (ret < 0) return ret; Loading @@ -85,7 +77,7 @@ static void bd9571mwv_gpio_set(struct gpio_chip *chip, unsigned int offset, { struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip); regmap_update_bits(gpio->bd->regmap, BD9571MWV_GPIO_OUT, regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_OUT, BIT(offset), value ? BIT(offset) : 0); } Loading Loading @@ -113,9 +105,9 @@ static int bd9571mwv_gpio_probe(struct platform_device *pdev) platform_set_drvdata(pdev, gpio); gpio->bd = dev_get_drvdata(pdev->dev.parent); gpio->regmap = dev_get_regmap(pdev->dev.parent, NULL); gpio->chip = template_chip; gpio->chip.parent = gpio->bd->dev; gpio->chip.parent = pdev->dev.parent; ret = devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio); if (ret < 0) { Loading @@ -127,7 +119,8 @@ static int bd9571mwv_gpio_probe(struct platform_device *pdev) } static const struct platform_device_id bd9571mwv_gpio_id_table[] = { { "bd9571mwv-gpio", }, { "bd9571mwv-gpio", ROHM_CHIP_TYPE_BD9571 }, { "bd9574mwf-gpio", ROHM_CHIP_TYPE_BD9574 }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(platform, bd9571mwv_gpio_id_table); Loading
drivers/mfd/axp20x-i2c.c +3 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,9 @@ static int axp20x_i2c_remove(struct i2c_client *i2c) { struct axp20x_dev *axp20x = i2c_get_clientdata(i2c); return axp20x_device_remove(axp20x); axp20x_device_remove(axp20x); return 0; } #ifdef CONFIG_OF Loading
drivers/mfd/axp20x-rsb.c +2 −2 Original line number Diff line number Diff line Loading @@ -49,11 +49,11 @@ static int axp20x_rsb_probe(struct sunxi_rsb_device *rdev) return axp20x_device_probe(axp20x); } static int axp20x_rsb_remove(struct sunxi_rsb_device *rdev) static void axp20x_rsb_remove(struct sunxi_rsb_device *rdev) { struct axp20x_dev *axp20x = sunxi_rsb_device_get_drvdata(rdev); return axp20x_device_remove(axp20x); axp20x_device_remove(axp20x); } static const struct of_device_id axp20x_rsb_of_match[] = { Loading