summaryrefslogtreecommitdiff
path: root/drivers/char/ipmi/kcs_bmc_npcm7xx.c
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2021-06-08 13:47:43 +0300
committerCorey Minyard <cminyard@mvista.com>2021-06-22 03:50:12 +0300
commitec6f0cf17a639743e622d4156b0a5009263fd479 (patch)
tree3d1c5697de3b2cb243faf0aa35553cb5e85f5c94 /drivers/char/ipmi/kcs_bmc_npcm7xx.c
parent78ca0c0549803ab0f5ecab43e295111b7ccdc7f2 (diff)
downloadlinux-ec6f0cf17a639743e622d4156b0a5009263fd479.tar.xz
ipmi: kcs_bmc: Make status update atomic
Enable more efficient implementation of read-modify-write sequences. Both device drivers for the KCS BMC stack use regmaps. The new callback allows us to exploit regmap_update_bits(). Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Reviewed-by: Zev Weiss <zweiss@equinix.com> Message-Id: <20210608104757.582199-3-andrew@aj.id.au> Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char/ipmi/kcs_bmc_npcm7xx.c')
-rw-r--r--drivers/char/ipmi/kcs_bmc_npcm7xx.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/char/ipmi/kcs_bmc_npcm7xx.c b/drivers/char/ipmi/kcs_bmc_npcm7xx.c
index 722f7391fe1f..1f44aadec9e8 100644
--- a/drivers/char/ipmi/kcs_bmc_npcm7xx.c
+++ b/drivers/char/ipmi/kcs_bmc_npcm7xx.c
@@ -97,6 +97,15 @@ static void npcm7xx_kcs_outb(struct kcs_bmc *kcs_bmc, u32 reg, u8 data)
WARN(rc != 0, "regmap_write() failed: %d\n", rc);
}
+static void npcm7xx_kcs_updateb(struct kcs_bmc *kcs_bmc, u32 reg, u8 mask, u8 data)
+{
+ struct npcm7xx_kcs_bmc *priv = kcs_bmc_priv(kcs_bmc);
+ int rc;
+
+ rc = regmap_update_bits(priv->map, reg, mask, data);
+ WARN(rc != 0, "regmap_update_bits() failed: %d\n", rc);
+}
+
static void npcm7xx_kcs_enable_channel(struct kcs_bmc *kcs_bmc, bool enable)
{
struct npcm7xx_kcs_bmc *priv = kcs_bmc_priv(kcs_bmc);
@@ -163,6 +172,7 @@ static int npcm7xx_kcs_probe(struct platform_device *pdev)
kcs_bmc->ioreg.str = priv->reg->sts;
kcs_bmc->io_inputb = npcm7xx_kcs_inb;
kcs_bmc->io_outputb = npcm7xx_kcs_outb;
+ kcs_bmc->io_updateb = npcm7xx_kcs_updateb;
dev_set_drvdata(dev, kcs_bmc);