summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorSubbaraman Narayanamurthy <subbaram@codeaurora.org>2017-03-07 19:26:14 -0800
committerSubbaraman Narayanamurthy <subbaram@codeaurora.org>2017-03-09 20:03:05 -0800
commit0ed3b2e19dc9d3d7067cd3af67bc51b061ed8049 (patch)
tree53bd084699d811813901fb43a53ab3f0bca31606 /include/linux
parentb8b4bc2271ff9e72eeac7f113b0ffc823e83e120 (diff)
misc: qpnp-misc: add support for clients to read register from misc device
On certain PMICs, PMIC peripheral drivers like haptics need to read MISC peripheral register. Add support for clients to read it by using qpnp_misc_read_reg(). Change-Id: Id5dfd9e440a8861b56572dab50839d1583535882 Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/qpnp-misc.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/include/linux/qpnp-misc.h b/include/linux/qpnp-misc.h
index ab3302f6ea78..7d95bf24a425 100644
--- a/include/linux/qpnp-misc.h
+++ b/include/linux/qpnp-misc.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2014, 2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -29,8 +29,26 @@
*/
int qpnp_misc_irqs_available(struct device *consumer_dev);
+
+/**
+ * qpnp_misc_read_reg - read register from misc device
+ *
+ * @node: device node pointer
+ * @address: address offset in misc peripheral to be read
+ * @val: data read from register
+ *
+ * This function returns zero if reading the MISC register succeeds.
+ *
+ */
+
+int qpnp_misc_read_reg(struct device_node *node, u16 addr, u8 *val);
#else
-static int qpnp_misc_irqs_available(struct device *consumer_dev)
+static inline int qpnp_misc_irqs_available(struct device *consumer_dev)
+{
+ return 0;
+}
+static inline int qpnp_misc_read_reg(struct device_node *node, u16 addr,
+ u8 *val)
{
return 0;
}