mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:04:43 +01:00
Pin control fixes for the v7.0 series:
- Rename and fix up the Intel Equilibrium immutable interrupt
chip.
- Handle the Qualcomm QCS615 dual edge GPIO IRQ by adding the
right flag.
- Fix a memory leak in the widely used
pinconf_generic_parse_dt_config() and a more local leak
in aml_dt_node_to_map_pinmux().
- Fix double put in the Cirrus cs42l43_pin_probe().
- Staticize amdisp_pinctrl_ops, Qualcomm SDM660 groups and
functions.
- Unexport CIX sky1_pinctrl_pm_ops.
- Fix configuration of deferred pin in the Rockchip driver.
- Implement .get_direction() in the Sunxi driver quelching
a dmesg warning message.
- Fix a readout of the last bank of registers in the
Cypress CY8C95x0 driver.
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmmn5pUACgkQQRCzN7AZ
XXMUBQ/8C7CXyAlP/RFrJasvdMNSLxOHFoutBXQWM+bvbULK80EbbIpbguwdQUm/
PkuozjJynt76zc4BgymqQDoCGQXIubVvhgYZMpDlJ9zcaqYeW8AwY4SlpYSpDqRw
jpZwhpDxRGK8BelmN6mjMYrW1HL4hc70fyy6aIT/XS5wNCx/NSI2EJ/8PhWga7tS
husAaXLk4i6dG4xFC4TUs5BepJAsTYnHc/L2XHY6d+OXxpvBcley964n5X2KmvG7
IrDrx2+9AcJGk84pZFgd1yODDTZ4yL2fJbxbwT7Qy4ZEVDKd/HviKGnA3Z8mdE5/
+ZvzPdOir0MKnKt6lEAVhGwduN1KsZei6lIZIMBMByYtpU+dAnm89mMD3LR2aRYH
WmdUm4ml7fN6ghvqfZcjYcj7hlMWKc91LPiMMEWDCac8Gn1hDneN0z/VuIOovWM2
JyTtdaCIV9XdCDM0AbVmlUsvuCBF+T3jiXQE3k2TgUWLFFxes7DaKMbDvRoR+JsA
35VTvJzjpexZ1l1eGhmwsCOcnuxoH/FJ9gwJmXEy+nSB8oY2x4b8LGR+RgSI+R9W
OJ/D08Z01IxXS69Acj6dl0N2LDjt5YoWVavqhtAMbRDkmU/W8DnTJxzHjNBaVrAE
lfefWDwiMxOBCzMvJTQFm+NFe22b/uk19mrDqs+ibqJnIVBXdrE=
=5Sap
-----END PGP SIGNATURE-----
Merge tag 'pinctrl-v7.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control fixes from Linus Walleij:
"All of these are driver fixes except a memory leak in the
pinconf_generic_parse_dt_config() helper which is the most
important fix.
- Rename and fix up the Intel Equilibrium immutable interrupt chip
- Handle the Qualcomm QCS615 dual edge GPIO IRQ by adding the right
flag
- Fix a memory leak in the widely used pinconf_generic_parse_dt_config()
and a more local leak in aml_dt_node_to_map_pinmux()
- Fix double put in the Cirrus cs42l43_pin_probe()
- Staticize amdisp_pinctrl_ops, Qualcomm SDM660 groups and functions
- Unexport CIX sky1_pinctrl_pm_ops
- Fix configuration of deferred pin in the Rockchip driver
- Implement .get_direction() in the Sunxi driver squelching a dmesg
warning message
- Fix a readout of the last bank of registers in the Cypress CY8C95x0
driver"
* tag 'pinctrl-v7.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
pinctrl: cy8c95x0: Don't miss reading the last bank registers
pinctrl: sunxi: Implement gpiochip::get_direction()
pinctrl: rockchip: Fix configuring a deferred pin
pinctrl: cirrus: cs42l43: Fix double-put in cs42l43_pin_probe()
pinctrl: meson: amlogic-a4: Fix device node reference leak in aml_dt_node_to_map_pinmux()
pinctrl: qcom: sdm660-lpass-lpi: Make groups and functions variables static
pinctrl: cix: sky1: Unexport sky1_pinctrl_pm_ops
pinctrl: amdisp: Make amdisp_pinctrl_ops variable static
pinctrl: pinconf-generic: Fix memory leak in pinconf_generic_parse_dt_config()
pinctrl: qcom: qcs615: Add missing dual edge GPIO IRQ errata flag
pinctrl: equilibrium: fix warning trace on load
pinctrl: equilibrium: rename irq_chip function callbacks
This commit is contained in:
commit
40d3f62247
11 changed files with 86 additions and 34 deletions
|
|
@ -574,10 +574,9 @@ static int cs42l43_pin_probe(struct platform_device *pdev)
|
|||
if (child) {
|
||||
ret = devm_add_action_or_reset(&pdev->dev,
|
||||
cs42l43_fwnode_put, child);
|
||||
if (ret) {
|
||||
fwnode_handle_put(child);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (!child->dev)
|
||||
child->dev = priv->dev;
|
||||
fwnode = child;
|
||||
|
|
|
|||
|
|
@ -522,11 +522,10 @@ static int __maybe_unused sky1_pinctrl_resume(struct device *dev)
|
|||
return pinctrl_force_default(spctl->pctl);
|
||||
}
|
||||
|
||||
const struct dev_pm_ops sky1_pinctrl_pm_ops = {
|
||||
static const struct dev_pm_ops sky1_pinctrl_pm_ops = {
|
||||
SET_LATE_SYSTEM_SLEEP_PM_OPS(sky1_pinctrl_suspend,
|
||||
sky1_pinctrl_resume)
|
||||
};
|
||||
EXPORT_SYMBOL_GPL(sky1_pinctrl_pm_ops);
|
||||
|
||||
static int sky1_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -679,7 +679,6 @@ static int aml_dt_node_to_map_pinmux(struct pinctrl_dev *pctldev,
|
|||
unsigned int *num_maps)
|
||||
{
|
||||
struct device *dev = pctldev->dev;
|
||||
struct device_node *pnode;
|
||||
unsigned long *configs = NULL;
|
||||
unsigned int num_configs = 0;
|
||||
struct property *prop;
|
||||
|
|
@ -693,7 +692,7 @@ static int aml_dt_node_to_map_pinmux(struct pinctrl_dev *pctldev,
|
|||
return -ENOENT;
|
||||
}
|
||||
|
||||
pnode = of_get_parent(np);
|
||||
struct device_node *pnode __free(device_node) = of_get_parent(np);
|
||||
if (!pnode) {
|
||||
dev_info(dev, "Missing function node\n");
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -351,13 +351,13 @@ int pinconf_generic_parse_dt_config(struct device_node *np,
|
|||
|
||||
ret = parse_dt_cfg(np, dt_params, ARRAY_SIZE(dt_params), cfg, &ncfg);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto out;
|
||||
if (pctldev && pctldev->desc->num_custom_params &&
|
||||
pctldev->desc->custom_params) {
|
||||
ret = parse_dt_cfg(np, pctldev->desc->custom_params,
|
||||
pctldev->desc->num_custom_params, cfg, &ncfg);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* no configs found at all */
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ static int amdisp_get_group_pins(struct pinctrl_dev *pctldev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
const struct pinctrl_ops amdisp_pinctrl_ops = {
|
||||
static const struct pinctrl_ops amdisp_pinctrl_ops = {
|
||||
.get_groups_count = amdisp_get_groups_count,
|
||||
.get_group_name = amdisp_get_group_name,
|
||||
.get_group_pins = amdisp_get_group_pins,
|
||||
|
|
|
|||
|
|
@ -627,7 +627,7 @@ static int cy8c95x0_write_regs_mask(struct cy8c95x0_pinctrl *chip, int reg,
|
|||
bitmap_scatter(tmask, mask, chip->map, MAX_LINE);
|
||||
bitmap_scatter(tval, val, chip->map, MAX_LINE);
|
||||
|
||||
for_each_set_clump8(offset, bits, tmask, chip->tpin) {
|
||||
for_each_set_clump8(offset, bits, tmask, chip->nport * BANK_SZ) {
|
||||
unsigned int i = offset / 8;
|
||||
|
||||
write_val = bitmap_get_value8(tval, offset);
|
||||
|
|
@ -655,7 +655,7 @@ static int cy8c95x0_read_regs_mask(struct cy8c95x0_pinctrl *chip, int reg,
|
|||
bitmap_scatter(tmask, mask, chip->map, MAX_LINE);
|
||||
bitmap_scatter(tval, val, chip->map, MAX_LINE);
|
||||
|
||||
for_each_set_clump8(offset, bits, tmask, chip->tpin) {
|
||||
for_each_set_clump8(offset, bits, tmask, chip->nport * BANK_SZ) {
|
||||
unsigned int i = offset / 8;
|
||||
|
||||
ret = cy8c95x0_regmap_read_bits(chip, reg, i, bits, &read_val);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#define PIN_NAME_LEN 10
|
||||
#define PAD_REG_OFF 0x100
|
||||
|
||||
static void eqbr_gpio_disable_irq(struct irq_data *d)
|
||||
static void eqbr_irq_mask(struct irq_data *d)
|
||||
{
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
struct eqbr_gpio_ctrl *gctrl = gpiochip_get_data(gc);
|
||||
|
|
@ -36,7 +36,7 @@ static void eqbr_gpio_disable_irq(struct irq_data *d)
|
|||
gpiochip_disable_irq(gc, offset);
|
||||
}
|
||||
|
||||
static void eqbr_gpio_enable_irq(struct irq_data *d)
|
||||
static void eqbr_irq_unmask(struct irq_data *d)
|
||||
{
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
struct eqbr_gpio_ctrl *gctrl = gpiochip_get_data(gc);
|
||||
|
|
@ -50,7 +50,7 @@ static void eqbr_gpio_enable_irq(struct irq_data *d)
|
|||
raw_spin_unlock_irqrestore(&gctrl->lock, flags);
|
||||
}
|
||||
|
||||
static void eqbr_gpio_ack_irq(struct irq_data *d)
|
||||
static void eqbr_irq_ack(struct irq_data *d)
|
||||
{
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
struct eqbr_gpio_ctrl *gctrl = gpiochip_get_data(gc);
|
||||
|
|
@ -62,10 +62,17 @@ static void eqbr_gpio_ack_irq(struct irq_data *d)
|
|||
raw_spin_unlock_irqrestore(&gctrl->lock, flags);
|
||||
}
|
||||
|
||||
static void eqbr_gpio_mask_ack_irq(struct irq_data *d)
|
||||
static void eqbr_irq_mask_ack(struct irq_data *d)
|
||||
{
|
||||
eqbr_gpio_disable_irq(d);
|
||||
eqbr_gpio_ack_irq(d);
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
struct eqbr_gpio_ctrl *gctrl = gpiochip_get_data(gc);
|
||||
unsigned int offset = irqd_to_hwirq(d);
|
||||
unsigned long flags;
|
||||
|
||||
raw_spin_lock_irqsave(&gctrl->lock, flags);
|
||||
writel(BIT(offset), gctrl->membase + GPIO_IRNENCLR);
|
||||
writel(BIT(offset), gctrl->membase + GPIO_IRNCR);
|
||||
raw_spin_unlock_irqrestore(&gctrl->lock, flags);
|
||||
}
|
||||
|
||||
static inline void eqbr_cfg_bit(void __iomem *addr,
|
||||
|
|
@ -92,7 +99,7 @@ static int eqbr_irq_type_cfg(struct gpio_irq_type *type,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int eqbr_gpio_set_irq_type(struct irq_data *d, unsigned int type)
|
||||
static int eqbr_irq_set_type(struct irq_data *d, unsigned int type)
|
||||
{
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
struct eqbr_gpio_ctrl *gctrl = gpiochip_get_data(gc);
|
||||
|
|
@ -166,11 +173,11 @@ static void eqbr_irq_handler(struct irq_desc *desc)
|
|||
|
||||
static const struct irq_chip eqbr_irq_chip = {
|
||||
.name = "gpio_irq",
|
||||
.irq_mask = eqbr_gpio_disable_irq,
|
||||
.irq_unmask = eqbr_gpio_enable_irq,
|
||||
.irq_ack = eqbr_gpio_ack_irq,
|
||||
.irq_mask_ack = eqbr_gpio_mask_ack_irq,
|
||||
.irq_set_type = eqbr_gpio_set_irq_type,
|
||||
.irq_ack = eqbr_irq_ack,
|
||||
.irq_mask = eqbr_irq_mask,
|
||||
.irq_mask_ack = eqbr_irq_mask_ack,
|
||||
.irq_unmask = eqbr_irq_unmask,
|
||||
.irq_set_type = eqbr_irq_set_type,
|
||||
.flags = IRQCHIP_IMMUTABLE,
|
||||
GPIOCHIP_IRQ_RESOURCE_HELPERS,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3640,14 +3640,10 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
* or the gpio driver hasn't probed yet.
|
||||
*/
|
||||
scoped_guard(mutex, &bank->deferred_lock) {
|
||||
if (!gpio || !gpio->direction_output) {
|
||||
rc = rockchip_pinconf_defer_pin(bank,
|
||||
pin - bank->pin_base,
|
||||
param, arg);
|
||||
if (rc)
|
||||
return rc;
|
||||
break;
|
||||
}
|
||||
if (!gpio || !gpio->direction_output)
|
||||
return rockchip_pinconf_defer_pin(bank,
|
||||
pin - bank->pin_base,
|
||||
param, arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1067,6 +1067,7 @@ static const struct msm_pinctrl_soc_data qcs615_tlmm = {
|
|||
.ntiles = ARRAY_SIZE(qcs615_tiles),
|
||||
.wakeirq_map = qcs615_pdc_map,
|
||||
.nwakeirq_map = ARRAY_SIZE(qcs615_pdc_map),
|
||||
.wakeirq_dual_edge_errata = true,
|
||||
};
|
||||
|
||||
static const struct of_device_id qcs615_tlmm_of_match[] = {
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ static const char * const pdm_clk_groups[] = { "gpio18" };
|
|||
static const char * const pdm_rx_groups[] = { "gpio21", "gpio23", "gpio25" };
|
||||
static const char * const pdm_sync_groups[] = { "gpio19" };
|
||||
|
||||
const struct lpi_pingroup sdm660_lpi_pinctrl_groups[] = {
|
||||
static const struct lpi_pingroup sdm660_lpi_pinctrl_groups[] = {
|
||||
LPI_PINGROUP_OFFSET(0, LPI_NO_SLEW, _, _, _, _, 0x0000),
|
||||
LPI_PINGROUP_OFFSET(1, LPI_NO_SLEW, _, _, _, _, 0x1000),
|
||||
LPI_PINGROUP_OFFSET(2, LPI_NO_SLEW, _, _, _, _, 0x2000),
|
||||
|
|
@ -113,7 +113,7 @@ const struct lpi_pingroup sdm660_lpi_pinctrl_groups[] = {
|
|||
LPI_PINGROUP_OFFSET(31, LPI_NO_SLEW, _, _, _, _, 0xb010),
|
||||
};
|
||||
|
||||
const struct lpi_function sdm660_lpi_pinctrl_functions[] = {
|
||||
static const struct lpi_function sdm660_lpi_pinctrl_functions[] = {
|
||||
LPI_FUNCTION(comp_rx),
|
||||
LPI_FUNCTION(dmic1_clk),
|
||||
LPI_FUNCTION(dmic1_data),
|
||||
|
|
|
|||
|
|
@ -204,6 +204,32 @@ sunxi_pinctrl_desc_find_function_by_pin(struct sunxi_pinctrl *pctl,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static struct sunxi_desc_function *
|
||||
sunxi_pinctrl_desc_find_function_by_pin_and_mux(struct sunxi_pinctrl *pctl,
|
||||
const u16 pin_num,
|
||||
const u8 muxval)
|
||||
{
|
||||
for (unsigned int i = 0; i < pctl->desc->npins; i++) {
|
||||
const struct sunxi_desc_pin *pin = pctl->desc->pins + i;
|
||||
struct sunxi_desc_function *func = pin->functions;
|
||||
|
||||
if (pin->pin.number != pin_num)
|
||||
continue;
|
||||
|
||||
if (pin->variant && !(pctl->variant & pin->variant))
|
||||
continue;
|
||||
|
||||
while (func->name) {
|
||||
if (func->muxval == muxval)
|
||||
return func;
|
||||
|
||||
func++;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int sunxi_pctrl_get_groups_count(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
|
@ -930,6 +956,30 @@ static const struct pinmux_ops sunxi_pmx_ops = {
|
|||
.strict = true,
|
||||
};
|
||||
|
||||
static int sunxi_pinctrl_gpio_get_direction(struct gpio_chip *chip,
|
||||
unsigned int offset)
|
||||
{
|
||||
struct sunxi_pinctrl *pctl = gpiochip_get_data(chip);
|
||||
const struct sunxi_desc_function *func;
|
||||
u32 pin = offset + chip->base;
|
||||
u32 reg, shift, mask;
|
||||
u8 muxval;
|
||||
|
||||
sunxi_mux_reg(pctl, offset, ®, &shift, &mask);
|
||||
|
||||
muxval = (readl(pctl->membase + reg) & mask) >> shift;
|
||||
|
||||
func = sunxi_pinctrl_desc_find_function_by_pin_and_mux(pctl, pin, muxval);
|
||||
if (!func)
|
||||
return -ENODEV;
|
||||
|
||||
if (!strcmp(func->name, "gpio_out"))
|
||||
return GPIO_LINE_DIRECTION_OUT;
|
||||
if (!strcmp(func->name, "gpio_in") || !strcmp(func->name, "irq"))
|
||||
return GPIO_LINE_DIRECTION_IN;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int sunxi_pinctrl_gpio_direction_input(struct gpio_chip *chip,
|
||||
unsigned offset)
|
||||
{
|
||||
|
|
@ -1599,6 +1649,7 @@ int sunxi_pinctrl_init_with_flags(struct platform_device *pdev,
|
|||
pctl->chip->request = gpiochip_generic_request;
|
||||
pctl->chip->free = gpiochip_generic_free;
|
||||
pctl->chip->set_config = gpiochip_generic_config;
|
||||
pctl->chip->get_direction = sunxi_pinctrl_gpio_get_direction;
|
||||
pctl->chip->direction_input = sunxi_pinctrl_gpio_direction_input;
|
||||
pctl->chip->direction_output = sunxi_pinctrl_gpio_direction_output;
|
||||
pctl->chip->get = sunxi_pinctrl_gpio_get;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue