mirror of
https://github.com/torvalds/linux.git
synced 2024-11-14 16:12:02 +00:00
5fed47abb3
On x86, make allmodconfig && make W=1 C=1 reports: WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/mfd/arizona.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/mfd/pcf50633-gpio.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/mfd/timberdale.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/mfd/ssbi.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/mfd/rt4831.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/mfd/intel_soc_pmic_bxtwc.o Add the missing invocation of the MODULE_DESCRIPTION() macro to all files which have a MODULE_LICENSE(). This includes mfd-core.c and vexpress-sysreg.c which, although they did not produce a warning with the x86 allmodconfig configuration, may cause this warning with other configurations. Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Acked-by: Andy Shevchenko <andy@kernel.org> # for Intel Broxton PMIC Link: https://lore.kernel.org/r/20240609-md-drivers-mfd-v1-1-47cdd0b394e9@quicinc.com Signed-off-by: Lee Jones <lee@kernel.org>
93 lines
2.5 KiB
C
93 lines
2.5 KiB
C
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
/* NXP PCF50633 GPIO Driver
|
|
*
|
|
* (C) 2006-2008 by Openmoko, Inc.
|
|
* Author: Balaji Rao <balajirrao@openmoko.org>
|
|
* All rights reserved.
|
|
*
|
|
* Broken down from monstrous PCF50633 driver mainly by
|
|
* Harald Welte, Andy Green and Werner Almesberger
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/mfd/pcf50633/core.h>
|
|
#include <linux/mfd/pcf50633/gpio.h>
|
|
#include <linux/mfd/pcf50633/pmic.h>
|
|
|
|
static const u8 pcf50633_regulator_registers[PCF50633_NUM_REGULATORS] = {
|
|
[PCF50633_REGULATOR_AUTO] = PCF50633_REG_AUTOOUT,
|
|
[PCF50633_REGULATOR_DOWN1] = PCF50633_REG_DOWN1OUT,
|
|
[PCF50633_REGULATOR_DOWN2] = PCF50633_REG_DOWN2OUT,
|
|
[PCF50633_REGULATOR_MEMLDO] = PCF50633_REG_MEMLDOOUT,
|
|
[PCF50633_REGULATOR_LDO1] = PCF50633_REG_LDO1OUT,
|
|
[PCF50633_REGULATOR_LDO2] = PCF50633_REG_LDO2OUT,
|
|
[PCF50633_REGULATOR_LDO3] = PCF50633_REG_LDO3OUT,
|
|
[PCF50633_REGULATOR_LDO4] = PCF50633_REG_LDO4OUT,
|
|
[PCF50633_REGULATOR_LDO5] = PCF50633_REG_LDO5OUT,
|
|
[PCF50633_REGULATOR_LDO6] = PCF50633_REG_LDO6OUT,
|
|
[PCF50633_REGULATOR_HCLDO] = PCF50633_REG_HCLDOOUT,
|
|
};
|
|
|
|
int pcf50633_gpio_set(struct pcf50633 *pcf, int gpio, u8 val)
|
|
{
|
|
u8 reg;
|
|
|
|
reg = gpio - PCF50633_GPIO1 + PCF50633_REG_GPIO1CFG;
|
|
|
|
return pcf50633_reg_set_bit_mask(pcf, reg, 0x07, val);
|
|
}
|
|
EXPORT_SYMBOL_GPL(pcf50633_gpio_set);
|
|
|
|
u8 pcf50633_gpio_get(struct pcf50633 *pcf, int gpio)
|
|
{
|
|
u8 reg, val;
|
|
|
|
reg = gpio - PCF50633_GPIO1 + PCF50633_REG_GPIO1CFG;
|
|
val = pcf50633_reg_read(pcf, reg) & 0x07;
|
|
|
|
return val;
|
|
}
|
|
EXPORT_SYMBOL_GPL(pcf50633_gpio_get);
|
|
|
|
int pcf50633_gpio_invert_set(struct pcf50633 *pcf, int gpio, int invert)
|
|
{
|
|
u8 val, reg;
|
|
|
|
reg = gpio - PCF50633_GPIO1 + PCF50633_REG_GPIO1CFG;
|
|
val = !!invert << 3;
|
|
|
|
return pcf50633_reg_set_bit_mask(pcf, reg, 1 << 3, val);
|
|
}
|
|
EXPORT_SYMBOL_GPL(pcf50633_gpio_invert_set);
|
|
|
|
int pcf50633_gpio_invert_get(struct pcf50633 *pcf, int gpio)
|
|
{
|
|
u8 reg, val;
|
|
|
|
reg = gpio - PCF50633_GPIO1 + PCF50633_REG_GPIO1CFG;
|
|
val = pcf50633_reg_read(pcf, reg);
|
|
|
|
return val & (1 << 3);
|
|
}
|
|
EXPORT_SYMBOL_GPL(pcf50633_gpio_invert_get);
|
|
|
|
int pcf50633_gpio_power_supply_set(struct pcf50633 *pcf,
|
|
int gpio, int regulator, int on)
|
|
{
|
|
u8 reg, val, mask;
|
|
|
|
/* the *ENA register is always one after the *OUT register */
|
|
reg = pcf50633_regulator_registers[regulator] + 1;
|
|
|
|
val = !!on << (gpio - PCF50633_GPIO1);
|
|
mask = 1 << (gpio - PCF50633_GPIO1);
|
|
|
|
return pcf50633_reg_set_bit_mask(pcf, reg, mask, val);
|
|
}
|
|
EXPORT_SYMBOL_GPL(pcf50633_gpio_power_supply_set);
|
|
|
|
MODULE_DESCRIPTION("NXP PCF50633 GPIO Driver");
|
|
MODULE_LICENSE("GPL");
|