summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2015-12-30 14:39:22 -0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-25 15:44:06 -0200
commit3def9ad6d3066e597d0ce86801a81eedb130b04a (patch)
tree5b5ec10b24709bf6fb471efb19ae17c05a4f0aee /drivers/media/rc
parenta73cfe527c10bb023f0e22dd8cf37dd418c093e7 (diff)
downloadblackbird-op-linux-3def9ad6d3066e597d0ce86801a81eedb130b04a.tar.gz
blackbird-op-linux-3def9ad6d3066e597d0ce86801a81eedb130b04a.zip
[media] nuvoton-cir: use request_muxed_region for accessing EFM registers
The two EFM ioports are accessed by drivers for other parts of the Nuvoton Super-IO chips too. Therefore access to these ioports needs to be protected by using request_muxed_region (like it's implemented e.g. in hwmon/nct6775 already). Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r--drivers/media/rc/nuvoton-cir.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c
index 081435cda30c..62c82c54ec82 100644
--- a/drivers/media/rc/nuvoton-cir.c
+++ b/drivers/media/rc/nuvoton-cir.c
@@ -80,17 +80,24 @@ static inline void nvt_clear_reg_bit(struct nvt_dev *nvt, u8 val, u8 reg)
}
/* enter extended function mode */
-static inline void nvt_efm_enable(struct nvt_dev *nvt)
+static inline int nvt_efm_enable(struct nvt_dev *nvt)
{
+ if (!request_muxed_region(nvt->cr_efir, 2, NVT_DRIVER_NAME))
+ return -EBUSY;
+
/* Enabling Extended Function Mode explicitly requires writing 2x */
outb(EFER_EFM_ENABLE, nvt->cr_efir);
outb(EFER_EFM_ENABLE, nvt->cr_efir);
+
+ return 0;
}
/* exit extended function mode */
static inline void nvt_efm_disable(struct nvt_dev *nvt)
{
outb(EFER_EFM_DISABLE, nvt->cr_efir);
+
+ release_region(nvt->cr_efir, 2);
}
/*
OpenPOWER on IntegriCloud