A set of pin control fixes for the v3.14 series:
- Fix chained interrupts, interrupt masking and register offset calculation for the sunxi driver. - Make MSM a bool rather than a tristate to stop build problems to happen - chained interrupt controllers cannot currently be defined in modules. - Fix a clock in the PFC driver. - Fix a kernel panic in the sirf driver. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJTF97HAAoJEEEQszewGV1zdgQP/jFi8k5EDOFL7gYuCjeBrvqF HLk8vQF3HHizfjY2+hHh38FV0pQOE+tuJOmn/zbFb5ZQniQeXjMOT6uQFwKyZsXv 8o6Ct0hPOc0LVId7NbwaL8oQ4tUd5KqFznOEhHzbQo8t9xsMBE5Q5Efo+9PRFCDW rdWshQy09nUgwXVi1BQBssk1y8Z2aMfiRFpzV0F6M4wI4oo8SPW2xsmmChn+e5wU EVeyNykfPdHQmc/yFR1GARhHH4ZqhGOkW2+j5Rp4UnhyfEsgeUI9tLknj7e6Ntp4 AJUE/++dLYYR4fYx0VjcddvvW6QgMSNq98JnRJ5gRNnLAi/c5u3Ic4d00gUO+gOj HQiQiCqyqifzFkkGOfKaUl5D8RGRZHQg3R4NnXgQ2/UrSQfOBd9Q6HPdPj8w6kQ4 13pyj2kqhmPydjTQLvCWzBp5EayLL3w06mfRdfxM4IluMjS2xv8NoYkKsmPEceFA MbpGD7ubDxBN0LkyESCg/ihNPbar56bYH4MPp/ycaghKmSXx1tcOl793yNnGHL5u N1JKQ7ZcOTV7dIvgyzmivtGv7Fet0Rb2aGdfCfweBG2uJcKZE++05s2B6I9ZBknx WvFnXkA/V/Q+lwXxubFNvst5C98SfZQq9BYwWXzD3Nv/9d/zfDmFDPxXFsGc/3MD Ist/2lEyd+ef6Nrf3rn4 =gGJ6 -----END PGP SIGNATURE----- Merge tag 'pinctrl-v3.14-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: "This is a set of pin control fixes I have collected over the last few days. Some have rotated more than others in linux-next, but they were rebased on v3.14-rc5 due to sloppy commit messages. I am quite convinced that they are all good fixes that only hit this or that individual driver and not the entire subsystem. - Fix chained interrupts, interrupt masking and register offset calculation for the sunxi driver - Make MSM a bool rather than a tristate to stop build problems to happen - chained interrupt controllers cannot currently be defined in modules - Fix a clock in the PFC driver - Fix a kernel panic in the sirf driver" * tag 'pinctrl-v3.14-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: sirf: fix kernel panic in gpio_lock_as_irq pinctrl: sh-pfc: r8a7791: SD1_CLK fix pinctrl: msm: make PINCTRL_MSM bool instead of tristate pinctrl: sunxi: Fix interrupt register offset calculation pinctrl: sunxi: Fix masking when setting irq type pinctrl: sunxi: use chained_irq_{enter, exit} for GIC compatibility
This commit is contained in:
commit
8ab47d3ec7
|
@ -217,7 +217,7 @@ config PINCTRL_IMX28
|
||||||
select PINCTRL_MXS
|
select PINCTRL_MXS
|
||||||
|
|
||||||
config PINCTRL_MSM
|
config PINCTRL_MSM
|
||||||
tristate
|
bool
|
||||||
select PINMUX
|
select PINMUX
|
||||||
select PINCONF
|
select PINCONF
|
||||||
select GENERIC_PINCONF
|
select GENERIC_PINCONF
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/gpio.h>
|
#include <linux/gpio.h>
|
||||||
#include <linux/irqdomain.h>
|
#include <linux/irqdomain.h>
|
||||||
|
#include <linux/irqchip/chained_irq.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
#include <linux/of_address.h>
|
#include <linux/of_address.h>
|
||||||
|
@ -584,7 +585,7 @@ static int sunxi_pinctrl_irq_set_type(struct irq_data *d,
|
||||||
spin_lock_irqsave(&pctl->lock, flags);
|
spin_lock_irqsave(&pctl->lock, flags);
|
||||||
|
|
||||||
regval = readl(pctl->membase + reg);
|
regval = readl(pctl->membase + reg);
|
||||||
regval &= ~IRQ_CFG_IRQ_MASK;
|
regval &= ~(IRQ_CFG_IRQ_MASK << index);
|
||||||
writel(regval | (mode << index), pctl->membase + reg);
|
writel(regval | (mode << index), pctl->membase + reg);
|
||||||
|
|
||||||
spin_unlock_irqrestore(&pctl->lock, flags);
|
spin_unlock_irqrestore(&pctl->lock, flags);
|
||||||
|
@ -665,6 +666,7 @@ static struct irq_chip sunxi_pinctrl_irq_chip = {
|
||||||
|
|
||||||
static void sunxi_pinctrl_irq_handler(unsigned irq, struct irq_desc *desc)
|
static void sunxi_pinctrl_irq_handler(unsigned irq, struct irq_desc *desc)
|
||||||
{
|
{
|
||||||
|
struct irq_chip *chip = irq_get_chip(irq);
|
||||||
struct sunxi_pinctrl *pctl = irq_get_handler_data(irq);
|
struct sunxi_pinctrl *pctl = irq_get_handler_data(irq);
|
||||||
const unsigned long reg = readl(pctl->membase + IRQ_STATUS_REG);
|
const unsigned long reg = readl(pctl->membase + IRQ_STATUS_REG);
|
||||||
|
|
||||||
|
@ -674,10 +676,12 @@ static void sunxi_pinctrl_irq_handler(unsigned irq, struct irq_desc *desc)
|
||||||
if (reg) {
|
if (reg) {
|
||||||
int irqoffset;
|
int irqoffset;
|
||||||
|
|
||||||
|
chained_irq_enter(chip, desc);
|
||||||
for_each_set_bit(irqoffset, ®, SUNXI_IRQ_NUMBER) {
|
for_each_set_bit(irqoffset, ®, SUNXI_IRQ_NUMBER) {
|
||||||
int pin_irq = irq_find_mapping(pctl->domain, irqoffset);
|
int pin_irq = irq_find_mapping(pctl->domain, irqoffset);
|
||||||
generic_handle_irq(pin_irq);
|
generic_handle_irq(pin_irq);
|
||||||
}
|
}
|
||||||
|
chained_irq_exit(chip, desc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -511,7 +511,7 @@ static inline u32 sunxi_pull_offset(u16 pin)
|
||||||
|
|
||||||
static inline u32 sunxi_irq_cfg_reg(u16 irq)
|
static inline u32 sunxi_irq_cfg_reg(u16 irq)
|
||||||
{
|
{
|
||||||
u8 reg = irq / IRQ_CFG_IRQ_PER_REG;
|
u8 reg = irq / IRQ_CFG_IRQ_PER_REG * 0x04;
|
||||||
return reg + IRQ_CFG_REG;
|
return reg + IRQ_CFG_REG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -523,7 +523,7 @@ static inline u32 sunxi_irq_cfg_offset(u16 irq)
|
||||||
|
|
||||||
static inline u32 sunxi_irq_ctrl_reg(u16 irq)
|
static inline u32 sunxi_irq_ctrl_reg(u16 irq)
|
||||||
{
|
{
|
||||||
u8 reg = irq / IRQ_CTRL_IRQ_PER_REG;
|
u8 reg = irq / IRQ_CTRL_IRQ_PER_REG * 0x04;
|
||||||
return reg + IRQ_CTRL_REG;
|
return reg + IRQ_CTRL_REG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -535,7 +535,7 @@ static inline u32 sunxi_irq_ctrl_offset(u16 irq)
|
||||||
|
|
||||||
static inline u32 sunxi_irq_status_reg(u16 irq)
|
static inline u32 sunxi_irq_status_reg(u16 irq)
|
||||||
{
|
{
|
||||||
u8 reg = irq / IRQ_STATUS_IRQ_PER_REG;
|
u8 reg = irq / IRQ_STATUS_IRQ_PER_REG * 0x04;
|
||||||
return reg + IRQ_STATUS_REG;
|
return reg + IRQ_STATUS_REG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,8 @@ enum {
|
||||||
|
|
||||||
/* GPSR6 */
|
/* GPSR6 */
|
||||||
FN_IP13_10, FN_IP13_11, FN_IP13_12, FN_IP13_13, FN_IP13_14,
|
FN_IP13_10, FN_IP13_11, FN_IP13_12, FN_IP13_13, FN_IP13_14,
|
||||||
FN_IP13_15, FN_IP13_18_16, FN_IP13_21_19, FN_IP13_22, FN_IP13_24_23,
|
FN_IP13_15, FN_IP13_18_16, FN_IP13_21_19,
|
||||||
|
FN_IP13_22, FN_IP13_24_23, FN_SD1_CLK,
|
||||||
FN_IP13_25, FN_IP13_26, FN_IP13_27, FN_IP13_30_28, FN_IP14_1_0,
|
FN_IP13_25, FN_IP13_26, FN_IP13_27, FN_IP13_30_28, FN_IP14_1_0,
|
||||||
FN_IP14_2, FN_IP14_3, FN_IP14_4, FN_IP14_5, FN_IP14_6, FN_IP14_7,
|
FN_IP14_2, FN_IP14_3, FN_IP14_4, FN_IP14_5, FN_IP14_6, FN_IP14_7,
|
||||||
FN_IP14_10_8, FN_IP14_13_11, FN_IP14_16_14, FN_IP14_19_17,
|
FN_IP14_10_8, FN_IP14_13_11, FN_IP14_16_14, FN_IP14_19_17,
|
||||||
|
@ -788,6 +789,7 @@ static const u16 pinmux_data[] = {
|
||||||
PINMUX_DATA(USB1_PWEN_MARK, FN_USB1_PWEN),
|
PINMUX_DATA(USB1_PWEN_MARK, FN_USB1_PWEN),
|
||||||
PINMUX_DATA(USB1_OVC_MARK, FN_USB1_OVC),
|
PINMUX_DATA(USB1_OVC_MARK, FN_USB1_OVC),
|
||||||
PINMUX_DATA(DU0_DOTCLKIN_MARK, FN_DU0_DOTCLKIN),
|
PINMUX_DATA(DU0_DOTCLKIN_MARK, FN_DU0_DOTCLKIN),
|
||||||
|
PINMUX_DATA(SD1_CLK_MARK, FN_SD1_CLK),
|
||||||
|
|
||||||
/* IPSR0 */
|
/* IPSR0 */
|
||||||
PINMUX_IPSR_DATA(IP0_0, D0),
|
PINMUX_IPSR_DATA(IP0_0, D0),
|
||||||
|
@ -3825,7 +3827,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
|
||||||
GP_6_11_FN, FN_IP13_25,
|
GP_6_11_FN, FN_IP13_25,
|
||||||
GP_6_10_FN, FN_IP13_24_23,
|
GP_6_10_FN, FN_IP13_24_23,
|
||||||
GP_6_9_FN, FN_IP13_22,
|
GP_6_9_FN, FN_IP13_22,
|
||||||
0, 0,
|
GP_6_8_FN, FN_SD1_CLK,
|
||||||
GP_6_7_FN, FN_IP13_21_19,
|
GP_6_7_FN, FN_IP13_21_19,
|
||||||
GP_6_6_FN, FN_IP13_18_16,
|
GP_6_6_FN, FN_IP13_18_16,
|
||||||
GP_6_5_FN, FN_IP13_15,
|
GP_6_5_FN, FN_IP13_15,
|
||||||
|
|
|
@ -598,7 +598,7 @@ static unsigned int sirfsoc_gpio_irq_startup(struct irq_data *d)
|
||||||
{
|
{
|
||||||
struct sirfsoc_gpio_bank *bank = irq_data_get_irq_chip_data(d);
|
struct sirfsoc_gpio_bank *bank = irq_data_get_irq_chip_data(d);
|
||||||
|
|
||||||
if (gpio_lock_as_irq(&bank->chip.gc, d->hwirq))
|
if (gpio_lock_as_irq(&bank->chip.gc, d->hwirq % SIRFSOC_GPIO_BANK_SIZE))
|
||||||
dev_err(bank->chip.gc.dev,
|
dev_err(bank->chip.gc.dev,
|
||||||
"unable to lock HW IRQ %lu for IRQ\n",
|
"unable to lock HW IRQ %lu for IRQ\n",
|
||||||
d->hwirq);
|
d->hwirq);
|
||||||
|
@ -611,7 +611,7 @@ static void sirfsoc_gpio_irq_shutdown(struct irq_data *d)
|
||||||
struct sirfsoc_gpio_bank *bank = irq_data_get_irq_chip_data(d);
|
struct sirfsoc_gpio_bank *bank = irq_data_get_irq_chip_data(d);
|
||||||
|
|
||||||
sirfsoc_gpio_irq_mask(d);
|
sirfsoc_gpio_irq_mask(d);
|
||||||
gpio_unlock_as_irq(&bank->chip.gc, d->hwirq);
|
gpio_unlock_as_irq(&bank->chip.gc, d->hwirq % SIRFSOC_GPIO_BANK_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct irq_chip sirfsoc_irq_chip = {
|
static struct irq_chip sirfsoc_irq_chip = {
|
||||||
|
|
Loading…
Reference in New Issue