Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipmi: NPCM7xx KCS BMC: enable interrupt to the host

Original kcs_bmc_npcm7xx.c was missing enabling to send interrupt to the
host on writes to output buffer.
This patch fixes it by setting the bits that enables the generation of
IRQn events by hardware control based on the status of the OBF flag.

Signed-off-by: Avi Fishman <AviFishman70@gmail.com>
Reviewed-by: Haiyue Wang <haiyue.wang@linux.intel.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>

authored by

Avi Fishman and committed by
Corey Minyard
58aae18e fe50a7d0

+14 -3
+14 -3
drivers/char/ipmi/kcs_bmc_npcm7xx.c
··· 39 39 #define KCS3CTL 0x3C 40 40 #define KCS_CTL_IBFIE BIT(0) 41 41 42 + #define KCS1IE 0x1C 43 + #define KCS2IE 0x2E 44 + #define KCS3IE 0x40 45 + #define KCS_IE_IRQE BIT(0) 46 + #define KCS_IE_HIRQE BIT(3) 47 + 42 48 /* 43 49 * 7.2.4 Core KCS Registers 44 50 * Registers in this module are 8 bits. An 8-bit register must be accessed ··· 54 48 * dob: KCS Channel n Data Out Buffer Register (KCSnDO). 55 49 * dib: KCS Channel n Data In Buffer Register (KCSnDI). 56 50 * ctl: KCS Channel n Control Register (KCSnCTL). 51 + * ie : KCS Channel n Interrupt Enable Register (KCSnIE). 57 52 */ 58 53 struct npcm7xx_kcs_reg { 59 54 u32 sts; 60 55 u32 dob; 61 56 u32 dib; 62 57 u32 ctl; 58 + u32 ie; 63 59 }; 64 60 65 61 struct npcm7xx_kcs_bmc { ··· 71 63 }; 72 64 73 65 static const struct npcm7xx_kcs_reg npcm7xx_kcs_reg_tbl[KCS_CHANNEL_MAX] = { 74 - { .sts = KCS1ST, .dob = KCS1DO, .dib = KCS1DI, .ctl = KCS1CTL }, 75 - { .sts = KCS2ST, .dob = KCS2DO, .dib = KCS2DI, .ctl = KCS2CTL }, 76 - { .sts = KCS3ST, .dob = KCS3DO, .dib = KCS3DI, .ctl = KCS3CTL }, 66 + { .sts = KCS1ST, .dob = KCS1DO, .dib = KCS1DI, .ctl = KCS1CTL, .ie = KCS1IE }, 67 + { .sts = KCS2ST, .dob = KCS2DO, .dib = KCS2DI, .ctl = KCS2CTL, .ie = KCS2IE }, 68 + { .sts = KCS3ST, .dob = KCS3DO, .dib = KCS3DI, .ctl = KCS3CTL, .ie = KCS3IE }, 77 69 }; 78 70 79 71 static u8 npcm7xx_kcs_inb(struct kcs_bmc *kcs_bmc, u32 reg) ··· 103 95 104 96 regmap_update_bits(priv->map, priv->reg->ctl, KCS_CTL_IBFIE, 105 97 enable ? KCS_CTL_IBFIE : 0); 98 + 99 + regmap_update_bits(priv->map, priv->reg->ie, KCS_IE_IRQE | KCS_IE_HIRQE, 100 + enable ? KCS_IE_IRQE | KCS_IE_HIRQE : 0); 106 101 } 107 102 108 103 static irqreturn_t npcm7xx_kcs_irq(int irq, void *arg)