Skip to content

Commit 74d5b41

Browse files
committed
Merge tag 'pinctrl-v6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control fixes from Linus Walleij: - Fix typos in UART1 and MMC in the Ingenic driver - A really well researched glitch bug fix to the Qualcomm driver that was tracked down and fixed by Dough Anderson from Chromium. Hats off for this one! - Revert two patches on the Xilinx ZynqMP driver: this needs a proper solution making use of firmware version information to adapt to different firmware releases - Fix interrupt triggers in the Ocelot driver * tag 'pinctrl-v6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: ocelot: Fix incorrect trigger of the interrupt. Revert "dt-bindings: pinctrl-zynqmp: Add output-enable configuration" Revert "pinctrl: pinctrl-zynqmp: Add support for output-enable and bias-high-impedance" pinctrl: qcom: Avoid glitching lines when we first mux to output pinctrl: Ingenic: JZ4755 bug fixes
2 parents 247f34f + e9945b2 commit 74d5b41

File tree

5 files changed

+36
-19
lines changed

5 files changed

+36
-19
lines changed

Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,6 @@ patternProperties:
274274
slew-rate:
275275
enum: [0, 1]
276276

277-
output-enable:
278-
description:
279-
This will internally disable the tri-state for MIO pins.
280-
281277
drive-strength:
282278
description:
283279
Selects the drive strength for MIO pins, in mA.

drivers/pinctrl/pinctrl-ingenic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ static u8 jz4755_lcd_24bit_funcs[] = { 1, 1, 1, 1, 0, 0, };
667667
static const struct group_desc jz4755_groups[] = {
668668
INGENIC_PIN_GROUP("uart0-data", jz4755_uart0_data, 0),
669669
INGENIC_PIN_GROUP("uart0-hwflow", jz4755_uart0_hwflow, 0),
670-
INGENIC_PIN_GROUP("uart1-data", jz4755_uart1_data, 0),
670+
INGENIC_PIN_GROUP("uart1-data", jz4755_uart1_data, 1),
671671
INGENIC_PIN_GROUP("uart2-data", jz4755_uart2_data, 1),
672672
INGENIC_PIN_GROUP("ssi-dt-b", jz4755_ssi_dt_b, 0),
673673
INGENIC_PIN_GROUP("ssi-dt-f", jz4755_ssi_dt_f, 0),
@@ -721,7 +721,7 @@ static const char *jz4755_ssi_groups[] = {
721721
"ssi-ce1-b", "ssi-ce1-f",
722722
};
723723
static const char *jz4755_mmc0_groups[] = { "mmc0-1bit", "mmc0-4bit", };
724-
static const char *jz4755_mmc1_groups[] = { "mmc0-1bit", "mmc0-4bit", };
724+
static const char *jz4755_mmc1_groups[] = { "mmc1-1bit", "mmc1-4bit", };
725725
static const char *jz4755_i2c_groups[] = { "i2c-data", };
726726
static const char *jz4755_cim_groups[] = { "cim-data", };
727727
static const char *jz4755_lcd_groups[] = {

drivers/pinctrl/pinctrl-ocelot.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,19 +1864,28 @@ static void ocelot_irq_unmask_level(struct irq_data *data)
18641864
if (val & bit)
18651865
ack = true;
18661866

1867+
/* Try to clear any rising edges */
1868+
if (!active && ack)
1869+
regmap_write_bits(info->map, REG(OCELOT_GPIO_INTR, info, gpio),
1870+
bit, bit);
1871+
18671872
/* Enable the interrupt now */
18681873
gpiochip_enable_irq(chip, gpio);
18691874
regmap_update_bits(info->map, REG(OCELOT_GPIO_INTR_ENA, info, gpio),
18701875
bit, bit);
18711876

18721877
/*
1873-
* In case the interrupt line is still active and the interrupt
1874-
* controller has not seen any changes in the interrupt line, then it
1875-
* means that there happen another interrupt while the line was active.
1878+
* In case the interrupt line is still active then it means that
1879+
* there happen another interrupt while the line was active.
18761880
* So we missed that one, so we need to kick the interrupt again
18771881
* handler.
18781882
*/
1879-
if (active && !ack) {
1883+
regmap_read(info->map, REG(OCELOT_GPIO_IN, info, gpio), &val);
1884+
if ((!(val & bit) && trigger_level == IRQ_TYPE_LEVEL_LOW) ||
1885+
(val & bit && trigger_level == IRQ_TYPE_LEVEL_HIGH))
1886+
active = true;
1887+
1888+
if (active) {
18801889
struct ocelot_irq_work *work;
18811890

18821891
work = kmalloc(sizeof(*work), GFP_ATOMIC);

drivers/pinctrl/pinctrl-zynqmp.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,6 @@ static int zynqmp_pinconf_cfg_set(struct pinctrl_dev *pctldev,
412412

413413
break;
414414
case PIN_CONFIG_BIAS_HIGH_IMPEDANCE:
415-
param = PM_PINCTRL_CONFIG_TRI_STATE;
416-
arg = PM_PINCTRL_TRI_STATE_ENABLE;
417-
ret = zynqmp_pm_pinctrl_set_config(pin, param, arg);
418-
break;
419415
case PIN_CONFIG_MODE_LOW_POWER:
420416
/*
421417
* These cases are mentioned in dts but configurable
@@ -424,11 +420,6 @@ static int zynqmp_pinconf_cfg_set(struct pinctrl_dev *pctldev,
424420
*/
425421
ret = 0;
426422
break;
427-
case PIN_CONFIG_OUTPUT_ENABLE:
428-
param = PM_PINCTRL_CONFIG_TRI_STATE;
429-
arg = PM_PINCTRL_TRI_STATE_DISABLE;
430-
ret = zynqmp_pm_pinctrl_set_config(pin, param, arg);
431-
break;
432423
default:
433424
dev_warn(pctldev->dev,
434425
"unsupported configuration parameter '%u'\n",

drivers/pinctrl/qcom/pinctrl-msm.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
* detection.
5252
* @skip_wake_irqs: Skip IRQs that are handled by wakeup interrupt controller
5353
* @disabled_for_mux: These IRQs were disabled because we muxed away.
54+
* @ever_gpio: This bit is set the first time we mux a pin to gpio_func.
5455
* @soc: Reference to soc_data of platform specific data.
5556
* @regs: Base addresses for the TLMM tiles.
5657
* @phys_base: Physical base address
@@ -72,6 +73,7 @@ struct msm_pinctrl {
7273
DECLARE_BITMAP(enabled_irqs, MAX_NR_GPIO);
7374
DECLARE_BITMAP(skip_wake_irqs, MAX_NR_GPIO);
7475
DECLARE_BITMAP(disabled_for_mux, MAX_NR_GPIO);
76+
DECLARE_BITMAP(ever_gpio, MAX_NR_GPIO);
7577

7678
const struct msm_pinctrl_soc_data *soc;
7779
void __iomem *regs[MAX_NR_TILES];
@@ -218,6 +220,25 @@ static int msm_pinmux_set_mux(struct pinctrl_dev *pctldev,
218220

219221
val = msm_readl_ctl(pctrl, g);
220222

223+
/*
224+
* If this is the first time muxing to GPIO and the direction is
225+
* output, make sure that we're not going to be glitching the pin
226+
* by reading the current state of the pin and setting it as the
227+
* output.
228+
*/
229+
if (i == gpio_func && (val & BIT(g->oe_bit)) &&
230+
!test_and_set_bit(group, pctrl->ever_gpio)) {
231+
u32 io_val = msm_readl_io(pctrl, g);
232+
233+
if (io_val & BIT(g->in_bit)) {
234+
if (!(io_val & BIT(g->out_bit)))
235+
msm_writel_io(io_val | BIT(g->out_bit), pctrl, g);
236+
} else {
237+
if (io_val & BIT(g->out_bit))
238+
msm_writel_io(io_val & ~BIT(g->out_bit), pctrl, g);
239+
}
240+
}
241+
221242
if (egpio_func && i == egpio_func) {
222243
if (val & BIT(g->egpio_present))
223244
val &= ~BIT(g->egpio_enable);

0 commit comments

Comments
 (0)