aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/fieldbus
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-11 15:36:02 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-11 15:36:02 -0700
commite786741ff1b52769b044b7f4407f39cd13ee5d2d (patch)
treee70502d7d4444fd77b66ebe14b1b3501ca8aad35 /drivers/staging/fieldbus
parentMerge tag 'char-misc-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc (diff)
parentstaging: kpc2000: simplify comparison to NULL in fileops.c (diff)
downloadlinux-dev-e786741ff1b52769b044b7f4407f39cd13ee5d2d.tar.xz
linux-dev-e786741ff1b52769b044b7f4407f39cd13ee5d2d.zip
Merge tag 'staging-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging and IIO driver updates from Greg KH: "Here is the big Staging and IIO driver update for 5.3-rc1. Lots of new IIO drivers are in here, along with loads of tiny staging driver cleanups and fixes. Overall we almost break even with the same lines added as removed. Full details are in the shortlog, they are too large to list here. All of these changes have been in linux-next for a while with no reported issues" * tag 'staging-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (608 commits) staging: kpc2000: simplify comparison to NULL in fileops.c staging: kpc2000: simplify comparison to NULL in dma.c staging: kpc2000: simplify comparison to NULL in kpc2000_spi.c staging: rtl8723bs: hal: remove redundant assignment to packetType staging: rtl8723bs: Change return type of hal_btcoex_IsBtDisabled() staging: rtl8723bs: Remove rtw_btcoex_DisplayBtCoexInfo() staging: rtl8723bs: Remove function rtw_btcoex_GetDBG() staging: rtl8723bs: Remove function rtw_btcoex_SetDBG() staging: rtl8723bs: Remove rtw_btcoex_IsBTCoexCtrlAMPDUSize() staging: rtl8723bs: Remove rtw_btcoex_BtInfoNotify() staging: rtl8723bs: Remove rtw_btcoex_ScanNotify() staging: rtl8723bs: Remove rtw_btcoex_SetSingleAntPath() staging: rtl8723bs: Remove rtw_btcoex_SetPGAntNum() staging: rtl8192e: remove redundant initialization of rtstatus staging: rtl8723bs: Remove rtw_btcoex_GetRaMask() staging: rtl8723bs: Remove rtw_btcoex_SetChipType() staging: rtl8723bs: Remove rtw_btcoex_ConnectNotify() staging: rtl8723bs: Remove rtw_btcoex_SetBTCoexist() staging: rtl8723bs: Remove rtw_btcoex_IsBtDisabled() staging: rtl8723bs: Remove rtw_btcoex_IsBtControlLps() ...
Diffstat (limited to 'drivers/staging/fieldbus')
-rw-r--r--drivers/staging/fieldbus/anybuss/Kconfig1
-rw-r--r--drivers/staging/fieldbus/anybuss/arcx-anybus.c44
-rw-r--r--drivers/staging/fieldbus/dev_core.c6
3 files changed, 17 insertions, 34 deletions
diff --git a/drivers/staging/fieldbus/anybuss/Kconfig b/drivers/staging/fieldbus/anybuss/Kconfig
index 8bc3d9a87743..635a0a7b7dd2 100644
--- a/drivers/staging/fieldbus/anybuss/Kconfig
+++ b/drivers/staging/fieldbus/anybuss/Kconfig
@@ -14,6 +14,7 @@ if HMS_ANYBUSS_BUS
config ARCX_ANYBUS_CONTROLLER
tristate "Arcx Anybus-S Controller"
depends on OF && GPIOLIB && HAS_IOMEM && REGULATOR
+ select REGMAP_MMIO
help
Select this to get support for the Arcx Anybus controller.
It connects to the SoC via a parallel memory bus, and
diff --git a/drivers/staging/fieldbus/anybuss/arcx-anybus.c b/drivers/staging/fieldbus/anybuss/arcx-anybus.c
index a167fb68e355..2ecffa42e561 100644
--- a/drivers/staging/fieldbus/anybuss/arcx-anybus.c
+++ b/drivers/staging/fieldbus/anybuss/arcx-anybus.c
@@ -111,49 +111,31 @@ static void export_reset_1(struct device *dev, bool assert)
* at a time for now.
*/
-static int read_reg_bus(void *context, unsigned int reg,
- unsigned int *val)
-{
- void __iomem *base = context;
-
- *val = readb(base + reg);
- return 0;
-}
-
-static int write_reg_bus(void *context, unsigned int reg,
- unsigned int val)
-{
- void __iomem *base = context;
-
- writeb(val, base + reg);
- return 0;
-}
+static const struct regmap_config arcx_regmap_cfg = {
+ .reg_bits = 16,
+ .val_bits = 8,
+ .max_register = 0x7ff,
+ .use_single_read = true,
+ .use_single_write = true,
+ /*
+ * single-byte parallel bus accesses are atomic, so don't
+ * require any synchronization.
+ */
+ .disable_locking = true,
+};
static struct regmap *create_parallel_regmap(struct platform_device *pdev,
int idx)
{
- struct regmap_config regmap_cfg = {
- .reg_bits = 11,
- .val_bits = 8,
- /*
- * single-byte parallel bus accesses are atomic, so don't
- * require any synchronization.
- */
- .disable_locking = true,
- .reg_read = read_reg_bus,
- .reg_write = write_reg_bus,
- };
struct resource *res;
void __iomem *base;
struct device *dev = &pdev->dev;
res = platform_get_resource(pdev, IORESOURCE_MEM, idx + 1);
- if (resource_size(res) < (1 << regmap_cfg.reg_bits))
- return ERR_PTR(-EINVAL);
base = devm_ioremap_resource(dev, res);
if (IS_ERR(base))
return ERR_CAST(base);
- return devm_regmap_init(dev, NULL, base, &regmap_cfg);
+ return devm_regmap_init_mmio(dev, base, &arcx_regmap_cfg);
}
static struct anybuss_host *
diff --git a/drivers/staging/fieldbus/dev_core.c b/drivers/staging/fieldbus/dev_core.c
index 60b85140675a..f6f5b92ba914 100644
--- a/drivers/staging/fieldbus/dev_core.c
+++ b/drivers/staging/fieldbus/dev_core.c
@@ -211,16 +211,16 @@ static ssize_t fieldbus_write(struct file *filp, const char __user *buf,
return fbdev->write_area(fbdev, buf, size, offset);
}
-static unsigned int fieldbus_poll(struct file *filp, poll_table *wait)
+static __poll_t fieldbus_poll(struct file *filp, poll_table *wait)
{
struct fb_open_file *of = filp->private_data;
struct fieldbus_dev *fbdev = of->fbdev;
- unsigned int mask = POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM;
+ __poll_t mask = EPOLLIN | EPOLLRDNORM | EPOLLOUT | EPOLLWRNORM;
poll_wait(filp, &fbdev->dc_wq, wait);
/* data changed ? */
if (fbdev->dc_event != of->dc_event)
- mask |= POLLPRI | POLLERR;
+ mask |= EPOLLPRI | EPOLLERR;
return mask;
}