Devicetree
 help / color / mirror / Atom feed
* [PATCH 2/4] drivers: base: cacheinfo: fix boot error message when acpi is enabled
From: Sudeep Holla @ 2016-10-28  8:45 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Greg Kroah-Hartman
  Cc: Sudeep Holla, x86-DgEjT+Ai2ygdnm+yROfE0A,
	devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1477644331-25559-1-git-send-email-sudeep.holla-5wv7dgnIgG8@public.gmane.org>

ARM64 enables both CONFIG_OF and CONFIG_ACPI and the firmware can pass
both ACPI tables and the device tree. Based on the kernel parameter, one
of the two will be chosen. If acpi is enabled, then device tree is not
unflattened.

Currently ARM64 platforms report:
"
	Failed to find cpu0 device node
	Unable to detect cache hierarchy from DT for CPU 0
"
which is incorrect when booting with ACPI. Also latest ACPI v6.1 has no
support for cache properties/hierarchy.

This patch adds check for unflattened device tree and also returns as
"not supported" if ACPI is runtime enabled.

It also removes the reference to DT from the error message as the cache
hierarchy can be detected from the firmware(OF/DT/ACPI)

Cc: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
Signed-off-by: Sudeep Holla <sudeep.holla-5wv7dgnIgG8@public.gmane.org>
---
 drivers/base/cacheinfo.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
index ecde8957835a..70e13cf06ed0 100644
--- a/drivers/base/cacheinfo.c
+++ b/drivers/base/cacheinfo.c
@@ -16,6 +16,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+#include <linux/acpi.h>
 #include <linux/bitops.h>
 #include <linux/cacheinfo.h>
 #include <linux/compiler.h>
@@ -104,12 +105,16 @@ static int cache_shared_cpu_map_setup(unsigned int cpu)
 	struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
 	struct cacheinfo *this_leaf, *sib_leaf;
 	unsigned int index;
-	int ret;
+	int ret = 0;
 
 	if (this_cpu_ci->cpu_map_populated)
 		return 0;
 
-	ret = cache_setup_of_node(cpu);
+	if (of_have_populated_dt())
+		ret = cache_setup_of_node(cpu);
+	else if (!acpi_disabled)
+		/* No cache property/hierarchy support yet in ACPI */
+		ret = -ENOTSUPP;
 	if (ret)
 		return ret;
 
@@ -206,8 +211,7 @@ static int detect_cache_attributes(unsigned int cpu)
 	 */
 	ret = cache_shared_cpu_map_setup(cpu);
 	if (ret) {
-		pr_warn("Unable to detect cache hierarchy from DT for CPU %d\n",
-			cpu);
+		pr_warn("Unable to detect cache hierarchy for CPU %d\n", cpu);
 		goto free_ci;
 	}
 	return 0;
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH 3/4] drivers: base: cacheinfo: add pr_fmt logging
From: Sudeep Holla @ 2016-10-28  8:45 UTC (permalink / raw)
  To: linux-kernel, Greg Kroah-Hartman; +Cc: Sudeep Holla, x86, devicetree
In-Reply-To: <1477644331-25559-1-git-send-email-sudeep.holla@arm.com>

This cleanup patch just adds pr_fmt style logging for cacheinfo.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/cacheinfo.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
index 70e13cf06ed0..f19d50bd8925 100644
--- a/drivers/base/cacheinfo.c
+++ b/drivers/base/cacheinfo.c
@@ -16,6 +16,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/acpi.h>
 #include <linux/bitops.h>
 #include <linux/cacheinfo.h>
-- 
2.7.4

^ permalink raw reply related

* [PATCH 4/4] drivers: base: cacheinfo: support DT overrides for cache properties
From: Sudeep Holla @ 2016-10-28  8:45 UTC (permalink / raw)
  To: linux-kernel, Greg Kroah-Hartman
  Cc: Sudeep Holla, x86, devicetree, Alex Van Brunt
In-Reply-To: <1477644331-25559-1-git-send-email-sudeep.holla@arm.com>

Few architectures like x86, ia64 and s390 derive the cache topology and
all the properties using a specific architected mechanism while some
other architectures like powerpc all those information id derived from
the device tree.

On ARM, both the mechanism is used. While all the cache properties can
be derived in a architected way, it needs to rely on device tree to get
the cache topology information.

However there are few platforms where this architected mechanism is
broken and the device tree properties can be used to override these
incorrect values.

This patch adds support for overriding the cache properties values to
the values specified in the device tree.

Cc: Alex Van Brunt <avanbrunt@nvidia.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/cacheinfo.c | 121 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 121 insertions(+)

diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
index f19d50bd8925..2376628c599c 100644
--- a/drivers/base/cacheinfo.c
+++ b/drivers/base/cacheinfo.c
@@ -88,7 +88,120 @@ static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf,
 {
 	return sib_leaf->of_node == this_leaf->of_node;
 }
+
+/* OF properties to query for a given cache type */
+struct cache_type_info {
+	const char *size_prop;
+	const char *line_size_props[2];
+	const char *nr_sets_prop;
+};
+
+static const struct cache_type_info cache_type_info[] = {
+	{
+		.size_prop       = "cache-size",
+		.line_size_props = { "cache-line-size",
+				     "cache-block-size", },
+		.nr_sets_prop    = "cache-sets",
+	}, {
+		.size_prop       = "i-cache-size",
+		.line_size_props = { "i-cache-line-size",
+				     "i-cache-block-size", },
+		.nr_sets_prop    = "i-cache-sets",
+	}, {
+		.size_prop       = "d-cache-size",
+		.line_size_props = { "d-cache-line-size",
+				     "d-cache-block-size", },
+		.nr_sets_prop    = "d-cache-sets",
+	},
+};
+
+static inline int get_cacheinfo_idx(enum cache_type type)
+{
+	if (type == CACHE_TYPE_UNIFIED)
+		return 0;
+	return type;
+}
+
+static void cache_size(struct cacheinfo *this_leaf)
+{
+	const char *propname;
+	const __be32 *cache_size;
+	int ct_idx;
+
+	ct_idx = get_cacheinfo_idx(this_leaf->type);
+	propname = cache_type_info[ct_idx].size_prop;
+
+	cache_size = of_get_property(this_leaf->of_node, propname, NULL);
+	if (cache_size)
+		this_leaf->size = of_read_number(cache_size, 1);
+}
+
+/* not cache_line_size() because that's a macro in include/linux/cache.h */
+static void cache_get_line_size(struct cacheinfo *this_leaf)
+{
+	const __be32 *line_size;
+	int i, lim, ct_idx;
+
+	ct_idx = get_cacheinfo_idx(this_leaf->type);
+	lim = ARRAY_SIZE(cache_type_info[ct_idx].line_size_props);
+
+	for (i = 0; i < lim; i++) {
+		const char *propname;
+
+		propname = cache_type_info[ct_idx].line_size_props[i];
+		line_size = of_get_property(this_leaf->of_node, propname, NULL);
+		if (line_size)
+			break;
+	}
+
+	if (line_size)
+		this_leaf->coherency_line_size = of_read_number(line_size, 1);
+}
+
+static void cache_nr_sets(struct cacheinfo *this_leaf)
+{
+	const char *propname;
+	const __be32 *nr_sets;
+	int ct_idx;
+
+	ct_idx = get_cacheinfo_idx(this_leaf->type);
+	propname = cache_type_info[ct_idx].nr_sets_prop;
+
+	nr_sets = of_get_property(this_leaf->of_node, propname, NULL);
+	if (nr_sets)
+		this_leaf->number_of_sets = of_read_number(nr_sets, 1);
+}
+
+static void cache_associativity(struct cacheinfo *this_leaf)
+{
+	unsigned int line_size = this_leaf->coherency_line_size;
+	unsigned int nr_sets = this_leaf->number_of_sets;
+	unsigned int size = this_leaf->size;
+
+	/*
+	 * If the cache is fully associative, there is no need to
+	 * check the other properties.
+	 */
+	if (!(nr_sets == 1) && (nr_sets > 0 && size > 0 && line_size > 0))
+		this_leaf->ways_of_associativity = (size / nr_sets) / line_size;
+}
+
+static void cache_of_override_properties(unsigned int cpu)
+{
+	int index;
+	struct cacheinfo *this_leaf;
+	struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
+
+	for (index = 0; index < cache_leaves(cpu); index++) {
+		this_leaf = this_cpu_ci->info_list + index;
+		cache_size(this_leaf);
+		cache_get_line_size(this_leaf);
+		cache_nr_sets(this_leaf);
+		cache_associativity(this_leaf);
+	}
+}
 #else
+static void cache_of_override_properties(unsigned int cpu) { }
 static inline int cache_setup_of_node(unsigned int cpu) { return 0; }
 static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf,
 					   struct cacheinfo *sib_leaf)
@@ -171,6 +284,12 @@ static void cache_shared_cpu_map_remove(unsigned int cpu)
 	}
 }
 
+static void cache_override_properties(unsigned int cpu)
+{
+	if (of_have_populated_dt())
+		return cache_of_override_properties(cpu);
+}
+
 static void free_cache_attributes(unsigned int cpu)
 {
 	if (!per_cpu_cacheinfo(cpu))
@@ -216,6 +335,8 @@ static int detect_cache_attributes(unsigned int cpu)
 		pr_warn("Unable to detect cache hierarchy for CPU %d\n", cpu);
 		goto free_ci;
 	}
+
+	cache_override_properties(cpu);
 	return 0;
 
 free_ci:
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH 4/5] ARM: davinci: enable LEDs default-on trigger in default config
From: Sekhar Nori @ 2016-10-28  9:03 UTC (permalink / raw)
  To: David Lechner, Kevin Hilman
  Cc: Rob Herring, Mark Rutland, Russell King,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <be478f0a-bd10-7241-7e9d-20dfc1beaa30-nq/r/kbU++upp/zk7JDF2g@public.gmane.org>

On Thursday 27 October 2016 09:19 PM, David Lechner wrote:
> Yes, module is OK here.

Here is the patch I pushed to v4.10/defconfig.

Thanks,
Sekhar

---8<---
From: David Lechner <david-nq/r/kbU++upp/zk7JDF2g@public.gmane.org>
Date: Fri, 21 Oct 2016 13:36:56 -0500
Subject: [PATCH] ARM: davinci_all_defconfig: enable LED default-on trigger

The LEDs default-on trigger is nice to have. For example, it can be used
to configure a LED as a power indicator.

Signed-off-by: David Lechner <david-nq/r/kbU++upp/zk7JDF2g@public.gmane.org>
[nsekhar-l0cyMroinI0@public.gmane.org: build as module, subject line fixes]
Signed-off-by: Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org>
---
 arch/arm/configs/davinci_all_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig
index 513978eaf03d..b5e978ff177f 100644
--- a/arch/arm/configs/davinci_all_defconfig
+++ b/arch/arm/configs/davinci_all_defconfig
@@ -180,6 +180,7 @@ CONFIG_LEDS_GPIO=m
 CONFIG_LEDS_TRIGGERS=y
 CONFIG_LEDS_TRIGGER_TIMER=m
 CONFIG_LEDS_TRIGGER_HEARTBEAT=m
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_OMAP=m
 CONFIG_DMADEVICES=y
-- 
2.9.0



--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* Re: [PATCH 1/1] ARM: dts: imx6ul-14x14-evk: add USB dual-role support
From: Peter Chen @ 2016-10-28  9:17 UTC (permalink / raw)
  To: Peter Chen
  Cc: shawnguo-DgEjT+Ai2ygdnm+yROfE0A,
	devicetree-u79uwXL29TY76Z2rM5mHXA, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ, fabio.estevam-3arQi8VN3Tc,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
In-Reply-To: <1470128903-942-1-git-send-email-peter.chen-3arQi8VN3Tc@public.gmane.org>

On Tue, Aug 2, 2016 at 5:08 PM, Peter Chen <peter.chen-3arQi8VN3Tc@public.gmane.org> wrote:
> With commit 851ce932242d ("usb: chipidea: otg: don't wait vbus
> drops below BSV when starts host"), the driver can support
> enabling vbus output without software control, so this board
> (control vbus output through ID pin) can support dual-role now.
>
> Signed-off-by: Peter Chen <peter.chen-3arQi8VN3Tc@public.gmane.org>
> ---
>  arch/arm/boot/dts/imx6ul-14x14-evk.dts | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/boot/dts/imx6ul-14x14-evk.dts b/arch/arm/boot/dts/imx6ul-14x14-evk.dts
> index e281d50..c5cf942 100644
> --- a/arch/arm/boot/dts/imx6ul-14x14-evk.dts
> +++ b/arch/arm/boot/dts/imx6ul-14x14-evk.dts
> @@ -225,7 +225,7 @@
>  };
>
>  &usbotg1 {
> -       dr_mode = "peripheral";
> +       dr_mode = "otg";
>         status = "okay";
>  };
>

Ping....


Peter
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH v2 3/3] reset: Add the TI SCI reset driver
From: Philipp Zabel @ 2016-10-28  9:36 UTC (permalink / raw)
  To: Andrew F. Davis
  Cc: Nishanth Menon, Tero Kristo, Santosh Shilimkar, Rob Herring,
	Mark Rutland, Suman Anna,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20161027214941.24641-4-afd-l0cyMroinI0@public.gmane.org>

Hi Andrew,

is there (going to be) as stable branch I can base these on, or should I
just wait until the prerequisite patches appear in arm-soc/for-next?

Am Donnerstag, den 27.10.2016, 16:49 -0500 schrieb Andrew F. Davis:
> Some TI Keystone family of SoCs contain a system controller (like the
> Power Management Micro Controller (PMMC) on K2G SoCs) that manage the
> low-level device control (like clocks, resets etc) for the various
> hardware modules present on the SoC. These device control operations
> are provided to the host processor OS through a communication protocol
> called the TI System Control Interface (TI SCI) protocol.
> 
> This patch adds a reset driver that communicates to the system
> controller over the TI SCI protocol for performing reset management
> of various devices present on the SoC. Various reset functionalities
> are achieved by the means of different TI SCI device operations
> provided by the TI SCI framework.
> 
> Signed-off-by: Andrew F. Davis <afd-l0cyMroinI0@public.gmane.org>
> [s-anna-l0cyMroinI0@public.gmane.org: documentation changes, revised commit message]
> Signed-off-by: Suman Anna <s-anna-l0cyMroinI0@public.gmane.org>
> Signed-off-by: Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>
> ---
>  MAINTAINERS                  |   1 +
>  drivers/reset/Kconfig        |   9 ++
>  drivers/reset/Makefile       |   1 +
>  drivers/reset/reset-ti-sci.c | 262 +++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 273 insertions(+)
>  create mode 100644 drivers/reset/reset-ti-sci.c
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index accf991..b93d91a 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -11901,6 +11901,7 @@ F:	include/dt-bindings/clock/k2g.h
>  F:	drivers/clk/keystone/sci-clk.c
>  F:	Documentation/devicetree/bindings/reset/ti,sci-reset.txt
>  F:	include/dt-bindings/reset/k2g.h
> +F:	drivers/reset/reset-ti-sci.c
>  
>  THANKO'S RAREMONO AM/FM/SW RADIO RECEIVER USB DRIVER
>  M:	Hans Verkuil <hverkuil-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org>
> diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
> index 06d9fa2..4c21c9d 100644
> --- a/drivers/reset/Kconfig
> +++ b/drivers/reset/Kconfig
> @@ -66,6 +66,15 @@ config RESET_SUNXI
>  	help
>  	  This enables the reset driver for Allwinner SoCs.
>  
> +config RESET_TI_SCI
> +	tristate "TI System Control Interface (TI-SCI) reset driver"
> +	depends on RESET_CONTROLLER
> +	depends on TI_SCI_PROTOCOL
> +	help
> +	  This enables the reset driver support over TI System Control Interface
> +	  available on some new TI SoCs. If you wish to use reset resources
> +	  managed by the TI System Controller, say Y here. Otherwise, say N.
> +
>  config TI_SYSCON_RESET
>  	tristate "TI SYSCON Reset Driver"
>  	depends on HAS_IOMEM
> diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
> index bbe7026..36321f2 100644
> --- a/drivers/reset/Makefile
> +++ b/drivers/reset/Makefile
> @@ -10,6 +10,7 @@ obj-$(CONFIG_RESET_PISTACHIO) += reset-pistachio.o
>  obj-$(CONFIG_RESET_SOCFPGA) += reset-socfpga.o
>  obj-$(CONFIG_RESET_STM32) += reset-stm32.o
>  obj-$(CONFIG_RESET_SUNXI) += reset-sunxi.o
> +obj-$(CONFIG_RESET_TI_SCI) += reset-ti-sci.o
>  obj-$(CONFIG_TI_SYSCON_RESET) += reset-ti-syscon.o
>  obj-$(CONFIG_RESET_UNIPHIER) += reset-uniphier.o
>  obj-$(CONFIG_RESET_ZYNQ) += reset-zynq.o
> diff --git a/drivers/reset/reset-ti-sci.c b/drivers/reset/reset-ti-sci.c
> new file mode 100644
> index 0000000..42ccf12
> --- /dev/null
> +++ b/drivers/reset/reset-ti-sci.c
> @@ -0,0 +1,262 @@
> +/*
> + * Texas Instrument's System Control Interface (TI-SCI) reset driver
> + *
> + * Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com/
> + *	Andrew F. Davis <afd-l0cyMroinI0@public.gmane.org>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed "as is" WITHOUT ANY WARRANTY of any
> + * kind, whether express or implied; without even the implied warranty
> + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <linux/idr.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
> +#include <linux/reset-controller.h>
> +#include <linux/soc/ti/ti_sci_protocol.h>
> +
> +/**
> + * struct ti_sci_reset_control - reset control structure
> + * @dev_id: SoC-specific device identifier
> + * @reset_mask: reset mask to use for toggling reset
> + */
> +struct ti_sci_reset_control {
> +	u32 dev_id;
> +	u32 reset_mask;
> +};
> +
> +/**
> + * struct ti_sci_reset_data - reset controller information structure
> + * @rcdev: reset controller entity
> + * @dev: reset controller device pointer
> + * @sci: TI SCI handle used for communication with system controller
> + * @idr: idr structure for mapping ids to reset control structures
> + */
> +struct ti_sci_reset_data {
> +	struct reset_controller_dev rcdev;
> +	struct device *dev;
> +	const struct ti_sci_handle *sci;
> +	struct idr idr;
> +};
> +
> +#define to_ti_sci_reset_data(p)	\
> +	container_of((p), struct ti_sci_reset_data, rcdev)
> +
> +/**
> + * ti_sci_reset_set() - program a device's reset
> + * @rcdev: reset controller entity
> + * @id: ID of the reset to toggle
> + * @assert: boolean flag to indicate assert or deassert
> + *
> + * This is a common internal function used to assert or deassert a device's
> + * reset using the TI SCI protocol. The device's reset is asserted if the
> + * @assert argument is true, or deasserted if @assert argument is false.
> + * The mechanism itself is a read-modify-write procedure, the current device
> + * reset register is read using a TI SCI device operation, the new value is
> + * set or un-set using the reset's mask, and the new reset value written by
> + * using another TI SCI device operation.
> + *
> + * Return: 0 for successful request, else a corresponding error value
> + */
> +static int ti_sci_reset_set(struct reset_controller_dev *rcdev,
> +			    unsigned long id, bool assert)
> +{
> +	struct ti_sci_reset_data *data = to_ti_sci_reset_data(rcdev);
> +	const struct ti_sci_handle *sci = data->sci;
> +	const struct ti_sci_dev_ops *dev_ops = &sci->ops.dev_ops;
> +	struct ti_sci_reset_control *control;
> +	u32 reset_state;
> +	int ret;
> +
> +	control = idr_find(&data->idr, id);
> +	if (!control)
> +		return -EINVAL;
> +
> +	ret = dev_ops->get_device_resets(sci, control->dev_id,
> +					 &reset_state);
> +	if (ret)
> +		return ret;
> +
> +	if (assert)
> +		reset_state |= control->reset_mask;
> +	else
> +		reset_state &= ~control->reset_mask;
> +
> +	return dev_ops->set_device_resets(sci, control->dev_id,
> +					  reset_state);

Without any locking? Maybe the read-modify-write could just be moved one
level down with an update_bits type of callback in the ti_sci_dev_ops.

> +}
> +
> +/**
> + * ti_sci_reset_assert() - assert device reset
> + * @rcdev: reset controller entity
> + * @id: ID of the reset to be asserted
> + *
> + * This function implements the reset driver op to assert a device's reset
> + * using the TI SCI protocol. This invokes the function ti_sci_reset_set()
> + * with the corresponding parameters as passed in, but with the @assert
> + * argument set to true for asserting the reset.
> + *
> + * Return: 0 for successful request, else a corresponding error value
> + */
> +static int ti_sci_reset_assert(struct reset_controller_dev *rcdev,
> +			       unsigned long id)
> +{
> +	return ti_sci_reset_set(rcdev, id, true);
> +}
> +
> +/**
> + * ti_sci_reset_deassert() - deassert device reset
> + * @rcdev: reset controller entity
> + * @id: ID of the reset to be deasserted
> + *
> + * This function implements the reset driver op to deassert a device's reset
> + * using the TI SCI protocol. This invokes the function ti_sci_reset_set()
> + * with the corresponding parameters as passed in, but with the @assert
> + * argument set to false for deasserting the reset.
> + *
> + * Return: 0 for successful request, else a corresponding error value
> + */
> +static int ti_sci_reset_deassert(struct reset_controller_dev *rcdev,
> +				 unsigned long id)
> +{
> +	return ti_sci_reset_set(rcdev, id, false);
> +}
> +
> +/**
> + * ti_sci_reset_status() - check device reset status
> + * @rcdev: reset controller entity
> + * @id: ID of reset to be checked
> + *
> + * This function implements the reset driver op to return the status of a
> + * device's reset using the TI SCI protocol. The reset register value is read
> + * by invoking the TI SCI device opertation .get_device_resets(), and the
> + * status of the specific reset is extracted and returned using this reset's
> + * reset mask.
> + *
> + * Return: 0 if reset is deasserted, or a non-zero value if reset is asserted
> + */
> +static int ti_sci_reset_status(struct reset_controller_dev *rcdev,
> +			       unsigned long id)
> +{
> +	struct ti_sci_reset_data *data = to_ti_sci_reset_data(rcdev);
> +	const struct ti_sci_handle *sci = data->sci;
> +	const struct ti_sci_dev_ops *dev_ops = &sci->ops.dev_ops;
> +	struct ti_sci_reset_control *control;
> +	u32 reset_state;
> +	int ret;
> +
> +	control = idr_find(&data->idr, id);
> +	if (!control)
> +		return -EINVAL;
> +
> +	ret = dev_ops->get_device_resets(sci, control->dev_id,
> +					 &reset_state);
> +	if (ret)
> +		return ret;
> +
> +	return reset_state & control->reset_mask;
> +}
> +
> +static struct reset_control_ops ti_sci_reset_ops = {
> +	.assert		= ti_sci_reset_assert,
> +	.deassert	= ti_sci_reset_deassert,
> +	.status		= ti_sci_reset_status,
> +};
> +
> +/**
> + * ti_sci_reset_of_xlate() - translate a set of OF arguments to a reset ID
> + * @rcdev: reset controller entity
> + * @reset_spec: OF reset argument specifier
> + *
> + * This function performs the translation of the reset argument specifier
> + * values defined in a reset consumer device node. The function allocates a
> + * reset control structure for that device reset, and will be used by the
> + * driver for performing any reset functions on that reset. An idr structure
> + * is allocated and used to map to the reset control structure. This idr
> + * is used by the driver to do reset lookups.
> + *
> + * Return: 0 for successful request, else a corresponding error value
> + */
> +static int ti_sci_reset_of_xlate(struct reset_controller_dev *rcdev,
> +				 const struct of_phandle_args *reset_spec)
> +{
> +	struct ti_sci_reset_data *data = to_ti_sci_reset_data(rcdev);
> +	struct ti_sci_reset_control *control;
> +
> +	if (WARN_ON(reset_spec->args_count != rcdev->of_reset_n_cells))
> +		return -EINVAL;
> +
> +	control = devm_kzalloc(data->dev, sizeof(*control), GFP_KERNEL);
> +	if (!control)
> +		return -ENOMEM;
> +
> +	control->dev_id = reset_spec->args[0];
> +	control->reset_mask = reset_spec->args[1];
> +
> +	return idr_alloc(&data->idr, control, 0, 0, GFP_KERNEL);
> +}
> +
> +static const struct of_device_id ti_sci_reset_of_match[] = {
> +	{ .compatible = "ti,sci-reset", },
> +	{ /* sentinel */ },
> +};
> +MODULE_DEVICE_TABLE(of, ti_sci_reset_of_match);
> +
> +static int ti_sci_reset_probe(struct platform_device *pdev)
> +{
> +	struct ti_sci_reset_data *data;
> +
> +	if (!pdev->dev.of_node)
> +		return -ENODEV;
> +
> +	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
> +	if (!data)
> +		return -ENOMEM;
> +
> +	data->sci = devm_ti_sci_get_handle(&pdev->dev);
> +	if (IS_ERR(data->sci))
> +		return PTR_ERR(data->sci);
> +
> +	data->rcdev.ops = &ti_sci_reset_ops;
> +	data->rcdev.owner = THIS_MODULE;
> +	data->rcdev.of_node = pdev->dev.of_node;
> +	data->rcdev.of_reset_n_cells = 2;
> +	data->rcdev.of_xlate = ti_sci_reset_of_xlate;
> +	data->dev = &pdev->dev;
> +	idr_init(&data->idr);
> +
> +	platform_set_drvdata(pdev, data);
> +
> +	return reset_controller_register(&data->rcdev);
> +}
> +
> +static int ti_sci_reset_remove(struct platform_device *pdev)
> +{
> +	struct ti_sci_reset_data *data = platform_get_drvdata(pdev);
> +
> +	reset_controller_unregister(&data->rcdev);
> +
> +	idr_destroy(&data->idr);
> +
> +	return 0;
> +}
> +
> +static struct platform_driver ti_sci_reset_driver = {
> +	.probe = ti_sci_reset_probe,
> +	.remove = ti_sci_reset_remove,
> +	.driver = {
> +		.name = "ti-sci-reset",
> +		.of_match_table = ti_sci_reset_of_match,
> +	},
> +};
> +module_platform_driver(ti_sci_reset_driver);
> +
> +MODULE_AUTHOR("Andrew F. Davis <afd-l0cyMroinI0@public.gmane.org>");
> +MODULE_DESCRIPTION("TI System Control Interface (TI SCI) Reset driver");
> +MODULE_LICENSE("GPL v2");

regards
Philipp

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH v9 1/4] soc: mediatek: Refine scpsys to support multiple platform
From: James Liao @ 2016-10-28  9:36 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: Sascha Hauer, Rob Herring, srv_heupstream-NuS5LvNUpcJWk0Htik3J/w,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Kevin Hilman,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <1d5cda95-467a-4f95-1cc9-b8f156271a54-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Hi Matthias,

Sorry for late reply due to our email service.

On Tue, 2016-10-25 at 16:04 +0200, Matthias Brugger wrote:
> Hi James,
> 
> On 10/20/2016 10:56 AM, James Liao wrote:
> > -static int scpsys_probe(struct platform_device *pdev)
> > +static void init_clks(struct platform_device *pdev, struct clk *clk[CLK_MAX])
> 
> I prefer struct clk **clk.

Okay.

> > +{
> > +	int i;
> > +
> > +	for (i = CLK_NONE + 1; i < CLK_MAX; i++)
> > +		clk[i] = devm_clk_get(&pdev->dev, clk_names[i]);
> > +}
> > +
> > +static struct scp *init_scp(struct platform_device *pdev,
> > +			const struct scp_domain_data *scp_domain_data, int num)
> >  {
> >  	struct genpd_onecell_data *pd_data;
> >  	struct resource *res;
> > -	int i, j, ret;
> > +	int i, j;
> >  	struct scp *scp;
> > -	struct clk *clk[MT8173_CLK_MAX];
> > +	struct clk *clk[CLK_MAX];
> 
> should be *[CLK_MAX - 1] but I would prefer to define in the enum:
> CLK_MAX = CLK_VENC_LT,

After init_clks() the clk[] will have valid contents between
clk[1]..clk[CLK_MAX-1], so it's necessary to declare clk[] with CLK_MAX
elements.

> If you are ok with it, I can fix both of my comments when applying.

Yes. struct clk **clk can be applied directly. But I think clk[CLK_MAX]
should be kept in current implementation.


Best regards,

James


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH v2 2/2] arm64: dts: hi6220: add resets property into dwmmc nodes
From: Jaehoon Chung @ 2016-10-28  9:43 UTC (permalink / raw)
  To: Leo Yan
  Cc: Vincent Guittot, John Stultz, Guodong Xu, Wei Xu, Rob Herring,
	Rob Herring, Mark Rutland, Catalin Marinas, Will Deacon,
	devicetree@vger.kernel.org, Xinliang Liu, linux-kernel,
	Fathi Boudra, LAK
In-Reply-To: <20161028073830.GC17266@leoy-linaro>

Hi,

On 10/28/2016 04:38 PM, Leo Yan wrote:
> On Fri, Oct 28, 2016 at 04:33:41PM +0900, Jaehoon Chung wrote:
> 
> [...]
> 
>>>>> Guodong: Is there any bootloader dependency on that change?
>>>>
>>>> FYI, I use firmwares available in AOSP
>>>
>>> I tried latest firmware [1], still cannot boot up until revert the
>>> patch "arm64: dts: hi6220: add resets property into dwmmc nodes".
>>
>> Could you share the log? Is there any log about failure?
> 
> Sure, please see below log:

It's related with -EPROBE_DEFER..I'm not sure but if CONFIG_RESET_CONTROLLER is enabled, it's searching for reset controller.
Maybe hi6220 has handled the reset controller(?)...

I'm checking devm_reset_control_xxx...It's possible to occur the other boards which enabled RESET_CONTROLLER..

Best Regards,
Jaehoon Chung

> 
> EFI stub: Booting Linux Kernel...
> EFI stub: Using DTB from configuration table
> EFI stub: Exiting boot services and installing virtual address map...
> [    0.000000] Booting Linux on physical CPU 0x0
> [    0.000000] Linux version 4.9.0-rc1-00251-g323792f (leoy@leoy-linaro) (gcc version 4.9.2 20140904 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) ) #589 SMP PREEMPT Fri Oct 28 15:35:15 CST 2016
> [    0.000000] Boot CPU: AArch64 Processor [410fd033]
> [    0.000000] efi: Getting EFI parameters from FDT:
> [    0.000000] efi: EFI v2.50 by hikey EFI Oct 26 2016 15:14:29
> [    0.000000] efi:  PROP=0x3d8297d8 
> [    0.000000] Reserved memory: created CMA memory pool at 0x000000002d000000, size 128 MiB
> [    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
> [    0.000000] psci: probing for conduit method from DT.
> [    0.000000] psci: PSCIv1.0 detected in firmware.
> [    0.000000] psci: Using standard PSCI v0.2 function IDs
> [    0.000000] psci: MIGRATE_INFO_TYPE not supported.
> [    0.000000] percpu: Embedded 21 pages/cpu @ffff80003df10000 s48000 r8192 d29824 u86016
> [    0.000000] Detected VIPT I-cache on CPU0
> [    0.000000] CPU features: enabling workaround for ARM erratum 845719
> [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 249229
> [    0.000000] Kernel command line: BOOT_IMAGE=(hd0,gpt6)/Image console=tty0 console=ttyAMA3,115200 root=/dev/disk/by-partlabel/system rootwait rw efi=noruntime
> [    0.000000] log_buf_len individual max cpu contribution: 4096 bytes
> [    0.000000] log_buf_len total cpu_extra contributions: 28672 bytes
> [    0.000000] log_buf_len min size: 16384 bytes
> [    0.000000] log_buf_len: 65536 bytes
> [    0.000000] early log buf free: 14468(88%)
> [    0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
> [    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
> [    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
> [    0.000000] Memory: 841572K/1012788K available (8316K kernel code, 860K rwdata, 3668K rodata, 1024K init, 283K bss, 40144K reserved, 131072K cma-reserved)
> [    0.000000] Virtual kernel memory layout:
> [    0.000000]     modules : 0xffff000000000000 - 0xffff000008000000   (   128 MB)
> [    0.000000]     vmalloc : 0xffff000008000000 - 0xffff7dffbfff0000   (129022 GB)
> [    0.000000]       .text : 0xffff000008080000 - 0xffff0000088a0000   (  8320 KB)
> [    0.000000]     .rodata : 0xffff0000088a0000 - 0xffff000008c40000   (  3712 KB)
> [    0.000000]       .init : 0xffff000008c40000 - 0xffff000008d40000   (  1024 KB)
> [    0.000000]       .data : 0xffff000008d40000 - 0xffff000008e17200   (   861 KB)
> [    0.000000]        .bss : 0xffff000008e17200 - 0xffff000008e5e0c0   (   284 KB)
> [    0.000000]     fixed   : 0xffff7dfffe7fd000 - 0xffff7dfffec00000   (  4108 KB)
> [    0.000000]     PCI I/O : 0xffff7dfffee00000 - 0xffff7dffffe00000   (    16 MB)
> [    0.000000]     vmemmap : 0xffff7e0000000000 - 0xffff800000000000   (  2048 GB maximum)
> [    0.000000]               0xffff7e0000000000 - 0xffff7e0000f80000   (    15 MB actual)
> [    0.000000]     memory  : 0xffff800000000000 - 0xffff80003e000000   (   992 MB)
> [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
> [    0.000000] Preemptible hierarchical RCU implementation.
> [    0.000000] 	Build-time adjustment of leaf fanout to 64.
> [    0.000000] 	RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=8.
> [    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=8
> [    0.000000] NR_IRQS:64 nr_irqs:64 0
> [    0.000000] GIC: Using split EOI/Deactivate mode
> [    0.000000] arm_arch_timer: Architected cp15 timer(s) running at 1.20MHz (phys).
> [    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x11b661f8e, max_idle_ns: 1763180809113 ns
> [    0.000004] sched_clock: 56 bits at 1200kHz, resolution 833ns, wraps every 4398046510838ns
> [    0.000101] clocksource: arm,sp804: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 99544814920 ns
> [    0.000108] sched_clock: 32 bits at 19MHz, resolution 52ns, wraps every 111848106981ns
> [    0.000495] Console: colour dummy device 80x25
> [    0.001193] console [tty0] enabled
> [    0.001224] Calibrating delay loop (skipped), value calculated using timer frequency.. 2.40 BogoMIPS (lpj=4800)
> [    0.001253] pid_max: default: 32768 minimum: 301
> [    0.001331] Security Framework initialized
> [    0.001373] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
> [    0.001392] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes)
> [    0.002258] ASID allocator initialised with 65536 entries
> [    0.032726] EFI runtime services will be disabled.
> [    0.080274] Detected VIPT I-cache on CPU1
> [    0.080323] CPU1: Booted secondary processor [410fd033]
> [    0.112299] Detected VIPT I-cache on CPU2
> [    0.112321] CPU2: Booted secondary processor [410fd033]
> [    0.144348] Detected VIPT I-cache on CPU3
> [    0.144369] CPU3: Booted secondary processor [410fd033]
> [    0.176488] Detected VIPT I-cache on CPU4
> [    0.176529] CPU4: Booted secondary processor [410fd033]
> [    0.208479] Detected VIPT I-cache on CPU5
> [    0.208501] CPU5: Booted secondary processor [410fd033]
> [    0.240546] Detected VIPT I-cache on CPU6
> [    0.240568] CPU6: Booted secondary processor [410fd033]
> [    0.272610] Detected VIPT I-cache on CPU7
> [    0.272632] CPU7: Booted secondary processor [410fd033]
> [    0.272708] Brought up 8 CPUs
> [    0.272887] SMP: Total of 8 processors activated.
> [    0.272904] CPU features: detected feature: 32-bit EL0 Support
> [    0.272975] CPU: All CPU(s) started at EL2
> [    0.273028] alternatives: patching kernel code
> [    0.273645] devtmpfs: initialized
> [    0.278919] DMI not present or invalid.
> [    0.279161] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
> [    0.282522] pinctrl core: initialized pinctrl subsystem
> [    0.283636] NET: Registered protocol family 16
> [    0.300541] cpuidle: using governor menu
> [    0.301073] vdso: 2 pages (1 code @ ffff0000088a7000, 1 data @ ffff000008d44000)
> [    0.301106] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
> [    0.301863] DMA: preallocated 256 KiB pool for atomic allocations
> [    0.302088] Serial: AMBA PL011 UART driver
> [    0.303683] f8015000.uart: ttyAMA0 at MMIO 0xf8015000 (irq = 7, base_baud = 0) is a PL011 rev2
> [    0.304121] uart-pl011 f7111000.uart: could not find pctldev for node /soc/pinmux@f7010000/uart1_pmx_func, deferring probe
> [    0.304340] uart-pl011 f7112000.uart: could not find pctldev for node /soc/pinmux@f7010000/uart2_pmx_func, deferring probe
> [    0.304580] uart-pl011 f7113000.uart: could not find pctldev for node /soc/pinmux@f7010000/uart3_pmx_func, deferring probe
> [    0.310373] hi6220-mbox f7510000.mailbox: Mailbox enabled
> [    0.341400] HugeTLB registered 2 MB page size, pre-allocated 0 pages
> [    0.342257] ACPI: Interpreter disabled.
> [    0.342953] vgaarb: loaded
> [    0.343177] SCSI subsystem initialized
> [    0.343450] ssp-pl022 f7106000.spi: could not find pctldev for node /soc/pinmux@f7010000/spi0_pmx_func, deferring probe
> [    0.343955] usbcore: registered new interface driver usbfs
> [    0.344042] usbcore: registered new interface driver hub
> [    0.344177] usbcore: registered new device driver usb
> [    0.344452] i2c_designware f7100000.i2c: could not find pctldev for node /soc/pinmux@f7010000/i2c0_pmx_func, deferring probe
> [    0.344494] i2c_designware f7101000.i2c: could not find pctldev for node /soc/pinmux@f7010000/i2c1_pmx_func, deferring probe
> [    0.344535] i2c_designware f7102000.i2c: could not find pctldev for node /soc/pinmux@f7010000/i2c2_pmx_func, deferring probe
> [    0.344915] pps_core: LinuxPPS API ver. 1 registered
> [    0.344931] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
> [    0.345003] PTP clock support registered
> [    0.345325] dmi: Firmware registration failed.
> [    0.345408] Registered efivars operations
> [    0.345580] Advanced Linux Sound Architecture Driver Initialized.
> [    0.346449] clocksource: Switched to clocksource arch_sys_counter
> [    0.346617] VFS: Disk quotas dquot_6.6.0
> [    0.346670] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
> [    0.346935] pnp: PnP ACPI: disabled
> [    0.355325] NET: Registered protocol family 2
> [    0.355797] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
> [    0.355885] TCP bind hash table entries: 8192 (order: 5, 131072 bytes)
> [    0.356026] TCP: Hash tables configured (established 8192 bind 8192)
> [    0.356085] UDP hash table entries: 512 (order: 2, 16384 bytes)
> [    0.356120] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
> [    0.356255] NET: Registered protocol family 1
> [    0.356569] RPC: Registered named UNIX socket transport module.
> [    0.356585] RPC: Registered udp transport module.
> [    0.356599] RPC: Registered tcp transport module.
> [    0.356613] RPC: Registered tcp NFSv4.1 backchannel transport module.
> [    0.356791] Unpacking initramfs...
> [    0.497134] Freeing initrd memory: 3576K (ffff8000372d5000 - ffff800037653000)
> [    0.497725] kvm [1]: 8-bit VMID
> [    0.497744] kvm [1]: IDMAP page: 890000
> [    0.497758] kvm [1]: HYP VA range: 800000000000:ffffffffffff
> [    0.498691] kvm [1]: Hyp mode initialized successfully
> [    0.498741] kvm [1]: vgic-v2@f6804000
> [    0.498936] kvm [1]: vgic interrupt IRQ1
> [    0.498978] kvm [1]: virtual timer IRQ4
> [    0.501267] futex hash table entries: 2048 (order: 6, 262144 bytes)
> [    0.501394] audit: initializing netlink subsys (disabled)
> [    0.501462] audit: type=2000 audit(0.495:1): initialized
> [    0.501845] workingset: timestamp_bits=46 max_order=18 bucket_order=0
> [    0.508960] squashfs: version 4.0 (2009/01/31) Phillip Lougher
> [    0.509596] NFS: Registering the id_resolver key type
> [    0.509632] Key type id_resolver registered
> [    0.509645] Key type id_legacy registered
> [    0.509665] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
> [    0.509833] 9p: Installing v9fs 9p2000 file system support
> [    0.512208] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
> [    0.512235] io scheduler noop registered
> [    0.512349] io scheduler cfq registered (default)
> [    0.513271] libphy: mdio_driver_register: phy-bcm-ns2-pci
> [    0.514198] pinctrl-single f7010000.pinmux: 159 pins at pa ffff000008e81000 size 636
> [    0.514612] pinctrl-single f7010800.pinmux: 163 pins at pa ffff000008e83800 size 652
> [    0.514770] pinctrl-single f8001800.pinmux: 30 pins at pa ffff000008e85800 size 120
> [    0.515809] pl061_gpio f8011000.gpio: PL061 GPIO chip @0x00000000f8011000 registered
> [    0.516214] pl061_gpio f8012000.gpio: PL061 GPIO chip @0x00000000f8012000 registered
> [    0.516610] pl061_gpio f8013000.gpio: PL061 GPIO chip @0x00000000f8013000 registered
> [    0.516687] gpio gpiochip3: gpio-line-names specifies 9 line names but there are 8 lines on the chip
> [    0.517038] pl061_gpio f8014000.gpio: PL061 GPIO chip @0x00000000f8014000 registered
> [    0.517416] pl061_gpio f7020000.gpio: PL061 GPIO chip @0x00000000f7020000 registered
> [    0.517796] pl061_gpio f7021000.gpio: PL061 GPIO chip @0x00000000f7021000 registered
> [    0.518172] pl061_gpio f7022000.gpio: PL061 GPIO chip @0x00000000f7022000 registered
> [    0.518577] pl061_gpio f7023000.gpio: PL061 GPIO chip @0x00000000f7023000 registered
> [    0.518658] gpio gpiochip8: gpio-line-names specifies 9 line names but there are 8 lines on the chip
> [    0.518999] pl061_gpio f7024000.gpio: PL061 GPIO chip @0x00000000f7024000 registered
> [    0.519385] pl061_gpio f7025000.gpio: PL061 GPIO chip @0x00000000f7025000 registered
> [    0.519774] pl061_gpio f7026000.gpio: PL061 GPIO chip @0x00000000f7026000 registered
> [    0.520162] pl061_gpio f7027000.gpio: PL061 GPIO chip @0x00000000f7027000 registered
> [    0.520550] pl061_gpio f7028000.gpio: PL061 GPIO chip @0x00000000f7028000 registered
> [    0.520939] pl061_gpio f7029000.gpio: PL061 GPIO chip @0x00000000f7029000 registered
> [    0.521324] pl061_gpio f702a000.gpio: PL061 GPIO chip @0x00000000f702a000 registered
> [    0.521719] pl061_gpio f702b000.gpio: PL061 GPIO chip @0x00000000f702b000 registered
> [    0.522107] pl061_gpio f702c000.gpio: PL061 GPIO chip @0x00000000f702c000 registered
> [    0.522505] pl061_gpio f702d000.gpio: PL061 GPIO chip @0x00000000f702d000 registered
> [    0.522884] pl061_gpio f702e000.gpio: PL061 GPIO chip @0x00000000f702e000 registered
> [    0.523275] pl061_gpio f702f000.gpio: PL061 GPIO chip @0x00000000f702f000 registered
> [    0.526086] xenfs: not registering filesystem on non-xen platform
> [    0.528934] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
> [    0.530124] SuperH (H)SCI(F) driver initialized
> [    0.530364] msm_serial: driver initialized
> [    0.536344] loop: module loaded
> [    0.539526] hisi_sas: driver version v1.6
> [    0.541976] libphy: Fixed MDIO Bus: probed
> [    0.542702] tun: Universal TUN/TAP device driver, 1.6
> [    0.542719] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
> [    0.543688] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
> [    0.543707] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
> [    0.543804] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.4.0-k
> [    0.543821] igb: Copyright (c) 2007-2014 Intel Corporation.
> [    0.543906] igbvf: Intel(R) Gigabit Virtual Function Network Driver - version 2.4.0-k
> [    0.543930] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
> [    0.544018] sky2: driver version 1.30
> [    0.544551] VFIO - User Level meta-driver version: 0.3
> [    0.546560] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
> [    0.546590] ehci-pci: EHCI PCI platform driver
> [    0.546638] ehci-platform: EHCI generic platform driver
> [    0.546730] ehci-exynos: EHCI EXYNOS driver
> [    0.546802] ehci-msm: Qualcomm On-Chip EHCI Host Controller
> [    0.546866] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
> [    0.546900] ohci-pci: OHCI PCI platform driver
> [    0.546952] ohci-platform: OHCI generic platform driver
> [    0.547024] ohci-exynos: OHCI EXYNOS driver
> [    0.547324] usbcore: registered new interface driver usb-storage
> [    0.547863] file system registered
> [    0.548183] mousedev: PS/2 mouse device common for all mice
> [    0.548621] input: HISI 65xx PowerOn Key as /devices/platform/f8000000.pmic/hi65xx-powerkey.0.auto/input/input0
> [    0.549253] rtc-pl031 f8003000.rtc: rtc core: registered pl031 as rtc0
> [    0.549459] rtc-pl031 f8004000.rtc: rtc core: registered pl031 as rtc1
> [    0.549796] i2c /dev entries driver
> [    0.552183] sdhci: Secure Digital Host Controller Interface driver
> [    0.552207] sdhci: Copyright(c) Pierre Ossman
> [    0.552403] Synopsys Designware Multimedia Card Interface Driver
> [    0.553405] sdhci-pltfm: SDHCI platform and OF driver helper
> [    0.554851] ledtrig-cpu: registered to indicate activity on CPUs
> [    0.555695] usbcore: registered new interface driver usbhid
> [    0.555717] usbhid: USB HID core driver
> [    0.557233] NET: Registered protocol family 17
> [    0.557320] 9pnet: Installing 9P2000 support
> [    0.557383] Key type dns_resolver registered
> [    0.557996] registered taskstats version 1
> [    0.561690] f7111000.uart: ttyAMA1 at MMIO 0xf7111000 (irq = 8, base_baud = 0) is a PL011 rev2
> [    0.562226] f7112000.uart: ttyAMA2 at MMIO 0xf7112000 (irq = 9, base_baud = 0) is a PL011 rev2
> [    0.562553] f7113000.uart: ttyAMA3 at MMIO 0xf7113000 (irq = 10, base_baud = 0) is a PL011 rev2
> [    1.916968] console [ttyAMA3] enabled
> [    1.922080] ssp-pl022 f7106000.spi: ARM PL022 driver, device ID: 0x00041022
> [    1.929144] ssp-pl022 f7106000.spi: mapped registers from 0x00000000f7106000 to ffff000008f03000
> [    1.938007] ssp-pl022 f7106000.spi: Failed to work in dma mode, work without dma!
> [    1.949535] f72c0000.usb supply vusb_d not found, using dummy regulator
> [    1.956256] f72c0000.usb supply vusb_a not found, using dummy regulator
> [    2.344873] dwc2 f72c0000.usb: EPs: 16, dedicated fifos, 1920 entries in SPRAM
> [    2.353154] dwc2 f72c0000.usb: DWC OTG Controller
> [    2.357891] dwc2 f72c0000.usb: new USB bus registered, assigned bus number 1
> [    2.364979] dwc2 f72c0000.usb: irq 38, io mem 0x00000000
> [    2.371082] hub 1-0:1.0: USB hub found
> [    2.374866] hub 1-0:1.0: 1 port detected
> [    2.382071] rtc-pl031 f8003000.rtc: setting system clock to 1970-01-01 00:00:19 UTC (19)
> [    2.390486] LDO2_2V8: disabling
> [    2.393639] LDO7_SDIO: disabling
> [    2.396900] LDO10_2V85: disabling
> [    2.400234] LDO13_1V8: disabling
> [    2.403476] LDO14_2V8: disabling
> [    2.406721] LDO17_2V5: disabling
> [    2.409956] LDO19_3V0: disabling
> [    2.413199] wlan-en-regulator: disabling
> [    2.417135] ALSA device list:
> [    2.420109]   No soundcards found.
> [    2.423712] uart-pl011 f7113000.uart: no DMA platform data
> [    2.429585] Freeing unused kernel memory: 1024K (ffff800000c40000 - ffff800000d40000)
> Loading, please wait...
> starting version 228
> [    2.479981] random: systemd-udevd: uninitialized urandom read (16 bytes read)
> [    2.483570] random: udevadm: uninitialized urandom read (16 bytes read)
> [    2.483680] random: udevadm: uninitialized urandom read (16 bytes read)
> [    2.485404] random: udevadm: uninitialized urandom read (16 bytes read)
> [    2.485631] random: udevadm: uninitialized urandom read (16 bytes read)
> [    2.485859] random: udevadm: uninitialized urandom read (16 bytes read)
> [    2.486098] random: udevadm: uninitialized urandom read (16 bytes read)
> [    2.486305] random: udevadm: uninitialized urandom read (16 bytes read)
> [    2.486729] random: udevadm: uninitialized urandom read (16 bytes read)
> [    2.486951] random: udevadm: uninitialized urandom read (16 bytes read)
> Begin: Loading essential drivers ... done.
> Begin: Running /scripts/init-premount ... done.
> Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
> Begin: Running /scripts/local-premount ... modprobe: can't change directory to '4.9.0-rc1-00251-g323792f': No such file or directory
> done.
> Begin: Waiting for root file system ... Begin: Running /scripts/local-block ... done.
> Begin: Running /scripts/local-block ... done.
> Begin: Running /scripts/local-block ... done.
> Begin: Running /scripts/local-block ... done.
> Begin: Running /scripts/local-block ... done.
> Begin: Running /scripts/local-block ... done.
> Begin: Running /scripts/local-block ... done.
> 
> Thanks,
> Leo Yan
> 
> 
> 

^ permalink raw reply

* Re: [PATCH v2 2/2] arm64: dts: hi6220: add resets property into dwmmc nodes
From: Jaehoon Chung @ 2016-10-28  9:54 UTC (permalink / raw)
  To: Leo Yan
  Cc: Vincent Guittot, John Stultz, Guodong Xu, Wei Xu, Rob Herring,
	Rob Herring, Mark Rutland, Catalin Marinas, Will Deacon,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Xinliang Liu,
	linux-kernel, Fathi Boudra, LAK
In-Reply-To: <24930ad4-313f-a4f0-c89a-770238863816-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>

Hi,

On 10/28/2016 06:43 PM, Jaehoon Chung wrote:
> Hi,
> 
> On 10/28/2016 04:38 PM, Leo Yan wrote:
>> On Fri, Oct 28, 2016 at 04:33:41PM +0900, Jaehoon Chung wrote:
>>
>> [...]
>>
>>>>>> Guodong: Is there any bootloader dependency on that change?
>>>>>
>>>>> FYI, I use firmwares available in AOSP
>>>>
>>>> I tried latest firmware [1], still cannot boot up until revert the
>>>> patch "arm64: dts: hi6220: add resets property into dwmmc nodes".
>>>
>>> Could you share the log? Is there any log about failure?
>>
>> Sure, please see below log:
> 
> It's related with -EPROBE_DEFER..I'm not sure but if CONFIG_RESET_CONTROLLER is enabled, it's searching for reset controller.
> Maybe hi6220 has handled the reset controller(?)...
> 
> I'm checking devm_reset_control_xxx...It's possible to occur the other boards which enabled RESET_CONTROLLER..

Could you check the below thing..

        /* find reset controller when exist */
-       pdata->rstc = devm_reset_control_get_optional(dev, NULL);
+       pdata->rstc = devm_reset_control_get_optional(dev, "dwmci-reset");
        if (IS_ERR(pdata->rstc)) {
                if (PTR_ERR(pdata->rstc) == -EPROBE_DEFER)
                        return ERR_PTR(-EPROBE_DEFER);

To prevent the wrong controlling, how about adding "#reset-names" for dwmmc controller?


Best Regards,
Jaehoon Chung

> 
> Best Regards,
> Jaehoon Chung
> 
>>
>> EFI stub: Booting Linux Kernel...
>> EFI stub: Using DTB from configuration table
>> EFI stub: Exiting boot services and installing virtual address map...
>> [    0.000000] Booting Linux on physical CPU 0x0
>> [    0.000000] Linux version 4.9.0-rc1-00251-g323792f (leoy@leoy-linaro) (gcc version 4.9.2 20140904 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) ) #589 SMP PREEMPT Fri Oct 28 15:35:15 CST 2016
>> [    0.000000] Boot CPU: AArch64 Processor [410fd033]
>> [    0.000000] efi: Getting EFI parameters from FDT:
>> [    0.000000] efi: EFI v2.50 by hikey EFI Oct 26 2016 15:14:29
>> [    0.000000] efi:  PROP=0x3d8297d8 
>> [    0.000000] Reserved memory: created CMA memory pool at 0x000000002d000000, size 128 MiB
>> [    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
>> [    0.000000] psci: probing for conduit method from DT.
>> [    0.000000] psci: PSCIv1.0 detected in firmware.
>> [    0.000000] psci: Using standard PSCI v0.2 function IDs
>> [    0.000000] psci: MIGRATE_INFO_TYPE not supported.
>> [    0.000000] percpu: Embedded 21 pages/cpu @ffff80003df10000 s48000 r8192 d29824 u86016
>> [    0.000000] Detected VIPT I-cache on CPU0
>> [    0.000000] CPU features: enabling workaround for ARM erratum 845719
>> [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 249229
>> [    0.000000] Kernel command line: BOOT_IMAGE=(hd0,gpt6)/Image console=tty0 console=ttyAMA3,115200 root=/dev/disk/by-partlabel/system rootwait rw efi=noruntime
>> [    0.000000] log_buf_len individual max cpu contribution: 4096 bytes
>> [    0.000000] log_buf_len total cpu_extra contributions: 28672 bytes
>> [    0.000000] log_buf_len min size: 16384 bytes
>> [    0.000000] log_buf_len: 65536 bytes
>> [    0.000000] early log buf free: 14468(88%)
>> [    0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
>> [    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
>> [    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
>> [    0.000000] Memory: 841572K/1012788K available (8316K kernel code, 860K rwdata, 3668K rodata, 1024K init, 283K bss, 40144K reserved, 131072K cma-reserved)
>> [    0.000000] Virtual kernel memory layout:
>> [    0.000000]     modules : 0xffff000000000000 - 0xffff000008000000   (   128 MB)
>> [    0.000000]     vmalloc : 0xffff000008000000 - 0xffff7dffbfff0000   (129022 GB)
>> [    0.000000]       .text : 0xffff000008080000 - 0xffff0000088a0000   (  8320 KB)
>> [    0.000000]     .rodata : 0xffff0000088a0000 - 0xffff000008c40000   (  3712 KB)
>> [    0.000000]       .init : 0xffff000008c40000 - 0xffff000008d40000   (  1024 KB)
>> [    0.000000]       .data : 0xffff000008d40000 - 0xffff000008e17200   (   861 KB)
>> [    0.000000]        .bss : 0xffff000008e17200 - 0xffff000008e5e0c0   (   284 KB)
>> [    0.000000]     fixed   : 0xffff7dfffe7fd000 - 0xffff7dfffec00000   (  4108 KB)
>> [    0.000000]     PCI I/O : 0xffff7dfffee00000 - 0xffff7dffffe00000   (    16 MB)
>> [    0.000000]     vmemmap : 0xffff7e0000000000 - 0xffff800000000000   (  2048 GB maximum)
>> [    0.000000]               0xffff7e0000000000 - 0xffff7e0000f80000   (    15 MB actual)
>> [    0.000000]     memory  : 0xffff800000000000 - 0xffff80003e000000   (   992 MB)
>> [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
>> [    0.000000] Preemptible hierarchical RCU implementation.
>> [    0.000000] 	Build-time adjustment of leaf fanout to 64.
>> [    0.000000] 	RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=8.
>> [    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=8
>> [    0.000000] NR_IRQS:64 nr_irqs:64 0
>> [    0.000000] GIC: Using split EOI/Deactivate mode
>> [    0.000000] arm_arch_timer: Architected cp15 timer(s) running at 1.20MHz (phys).
>> [    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x11b661f8e, max_idle_ns: 1763180809113 ns
>> [    0.000004] sched_clock: 56 bits at 1200kHz, resolution 833ns, wraps every 4398046510838ns
>> [    0.000101] clocksource: arm,sp804: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 99544814920 ns
>> [    0.000108] sched_clock: 32 bits at 19MHz, resolution 52ns, wraps every 111848106981ns
>> [    0.000495] Console: colour dummy device 80x25
>> [    0.001193] console [tty0] enabled
>> [    0.001224] Calibrating delay loop (skipped), value calculated using timer frequency.. 2.40 BogoMIPS (lpj=4800)
>> [    0.001253] pid_max: default: 32768 minimum: 301
>> [    0.001331] Security Framework initialized
>> [    0.001373] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
>> [    0.001392] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes)
>> [    0.002258] ASID allocator initialised with 65536 entries
>> [    0.032726] EFI runtime services will be disabled.
>> [    0.080274] Detected VIPT I-cache on CPU1
>> [    0.080323] CPU1: Booted secondary processor [410fd033]
>> [    0.112299] Detected VIPT I-cache on CPU2
>> [    0.112321] CPU2: Booted secondary processor [410fd033]
>> [    0.144348] Detected VIPT I-cache on CPU3
>> [    0.144369] CPU3: Booted secondary processor [410fd033]
>> [    0.176488] Detected VIPT I-cache on CPU4
>> [    0.176529] CPU4: Booted secondary processor [410fd033]
>> [    0.208479] Detected VIPT I-cache on CPU5
>> [    0.208501] CPU5: Booted secondary processor [410fd033]
>> [    0.240546] Detected VIPT I-cache on CPU6
>> [    0.240568] CPU6: Booted secondary processor [410fd033]
>> [    0.272610] Detected VIPT I-cache on CPU7
>> [    0.272632] CPU7: Booted secondary processor [410fd033]
>> [    0.272708] Brought up 8 CPUs
>> [    0.272887] SMP: Total of 8 processors activated.
>> [    0.272904] CPU features: detected feature: 32-bit EL0 Support
>> [    0.272975] CPU: All CPU(s) started at EL2
>> [    0.273028] alternatives: patching kernel code
>> [    0.273645] devtmpfs: initialized
>> [    0.278919] DMI not present or invalid.
>> [    0.279161] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
>> [    0.282522] pinctrl core: initialized pinctrl subsystem
>> [    0.283636] NET: Registered protocol family 16
>> [    0.300541] cpuidle: using governor menu
>> [    0.301073] vdso: 2 pages (1 code @ ffff0000088a7000, 1 data @ ffff000008d44000)
>> [    0.301106] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
>> [    0.301863] DMA: preallocated 256 KiB pool for atomic allocations
>> [    0.302088] Serial: AMBA PL011 UART driver
>> [    0.303683] f8015000.uart: ttyAMA0 at MMIO 0xf8015000 (irq = 7, base_baud = 0) is a PL011 rev2
>> [    0.304121] uart-pl011 f7111000.uart: could not find pctldev for node /soc/pinmux@f7010000/uart1_pmx_func, deferring probe
>> [    0.304340] uart-pl011 f7112000.uart: could not find pctldev for node /soc/pinmux@f7010000/uart2_pmx_func, deferring probe
>> [    0.304580] uart-pl011 f7113000.uart: could not find pctldev for node /soc/pinmux@f7010000/uart3_pmx_func, deferring probe
>> [    0.310373] hi6220-mbox f7510000.mailbox: Mailbox enabled
>> [    0.341400] HugeTLB registered 2 MB page size, pre-allocated 0 pages
>> [    0.342257] ACPI: Interpreter disabled.
>> [    0.342953] vgaarb: loaded
>> [    0.343177] SCSI subsystem initialized
>> [    0.343450] ssp-pl022 f7106000.spi: could not find pctldev for node /soc/pinmux@f7010000/spi0_pmx_func, deferring probe
>> [    0.343955] usbcore: registered new interface driver usbfs
>> [    0.344042] usbcore: registered new interface driver hub
>> [    0.344177] usbcore: registered new device driver usb
>> [    0.344452] i2c_designware f7100000.i2c: could not find pctldev for node /soc/pinmux@f7010000/i2c0_pmx_func, deferring probe
>> [    0.344494] i2c_designware f7101000.i2c: could not find pctldev for node /soc/pinmux@f7010000/i2c1_pmx_func, deferring probe
>> [    0.344535] i2c_designware f7102000.i2c: could not find pctldev for node /soc/pinmux@f7010000/i2c2_pmx_func, deferring probe
>> [    0.344915] pps_core: LinuxPPS API ver. 1 registered
>> [    0.344931] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti-k2GhghHVRtY@public.gmane.org>
>> [    0.345003] PTP clock support registered
>> [    0.345325] dmi: Firmware registration failed.
>> [    0.345408] Registered efivars operations
>> [    0.345580] Advanced Linux Sound Architecture Driver Initialized.
>> [    0.346449] clocksource: Switched to clocksource arch_sys_counter
>> [    0.346617] VFS: Disk quotas dquot_6.6.0
>> [    0.346670] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
>> [    0.346935] pnp: PnP ACPI: disabled
>> [    0.355325] NET: Registered protocol family 2
>> [    0.355797] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
>> [    0.355885] TCP bind hash table entries: 8192 (order: 5, 131072 bytes)
>> [    0.356026] TCP: Hash tables configured (established 8192 bind 8192)
>> [    0.356085] UDP hash table entries: 512 (order: 2, 16384 bytes)
>> [    0.356120] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
>> [    0.356255] NET: Registered protocol family 1
>> [    0.356569] RPC: Registered named UNIX socket transport module.
>> [    0.356585] RPC: Registered udp transport module.
>> [    0.356599] RPC: Registered tcp transport module.
>> [    0.356613] RPC: Registered tcp NFSv4.1 backchannel transport module.
>> [    0.356791] Unpacking initramfs...
>> [    0.497134] Freeing initrd memory: 3576K (ffff8000372d5000 - ffff800037653000)
>> [    0.497725] kvm [1]: 8-bit VMID
>> [    0.497744] kvm [1]: IDMAP page: 890000
>> [    0.497758] kvm [1]: HYP VA range: 800000000000:ffffffffffff
>> [    0.498691] kvm [1]: Hyp mode initialized successfully
>> [    0.498741] kvm [1]: vgic-v2@f6804000
>> [    0.498936] kvm [1]: vgic interrupt IRQ1
>> [    0.498978] kvm [1]: virtual timer IRQ4
>> [    0.501267] futex hash table entries: 2048 (order: 6, 262144 bytes)
>> [    0.501394] audit: initializing netlink subsys (disabled)
>> [    0.501462] audit: type=2000 audit(0.495:1): initialized
>> [    0.501845] workingset: timestamp_bits=46 max_order=18 bucket_order=0
>> [    0.508960] squashfs: version 4.0 (2009/01/31) Phillip Lougher
>> [    0.509596] NFS: Registering the id_resolver key type
>> [    0.509632] Key type id_resolver registered
>> [    0.509645] Key type id_legacy registered
>> [    0.509665] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
>> [    0.509833] 9p: Installing v9fs 9p2000 file system support
>> [    0.512208] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
>> [    0.512235] io scheduler noop registered
>> [    0.512349] io scheduler cfq registered (default)
>> [    0.513271] libphy: mdio_driver_register: phy-bcm-ns2-pci
>> [    0.514198] pinctrl-single f7010000.pinmux: 159 pins at pa ffff000008e81000 size 636
>> [    0.514612] pinctrl-single f7010800.pinmux: 163 pins at pa ffff000008e83800 size 652
>> [    0.514770] pinctrl-single f8001800.pinmux: 30 pins at pa ffff000008e85800 size 120
>> [    0.515809] pl061_gpio f8011000.gpio: PL061 GPIO chip @0x00000000f8011000 registered
>> [    0.516214] pl061_gpio f8012000.gpio: PL061 GPIO chip @0x00000000f8012000 registered
>> [    0.516610] pl061_gpio f8013000.gpio: PL061 GPIO chip @0x00000000f8013000 registered
>> [    0.516687] gpio gpiochip3: gpio-line-names specifies 9 line names but there are 8 lines on the chip
>> [    0.517038] pl061_gpio f8014000.gpio: PL061 GPIO chip @0x00000000f8014000 registered
>> [    0.517416] pl061_gpio f7020000.gpio: PL061 GPIO chip @0x00000000f7020000 registered
>> [    0.517796] pl061_gpio f7021000.gpio: PL061 GPIO chip @0x00000000f7021000 registered
>> [    0.518172] pl061_gpio f7022000.gpio: PL061 GPIO chip @0x00000000f7022000 registered
>> [    0.518577] pl061_gpio f7023000.gpio: PL061 GPIO chip @0x00000000f7023000 registered
>> [    0.518658] gpio gpiochip8: gpio-line-names specifies 9 line names but there are 8 lines on the chip
>> [    0.518999] pl061_gpio f7024000.gpio: PL061 GPIO chip @0x00000000f7024000 registered
>> [    0.519385] pl061_gpio f7025000.gpio: PL061 GPIO chip @0x00000000f7025000 registered
>> [    0.519774] pl061_gpio f7026000.gpio: PL061 GPIO chip @0x00000000f7026000 registered
>> [    0.520162] pl061_gpio f7027000.gpio: PL061 GPIO chip @0x00000000f7027000 registered
>> [    0.520550] pl061_gpio f7028000.gpio: PL061 GPIO chip @0x00000000f7028000 registered
>> [    0.520939] pl061_gpio f7029000.gpio: PL061 GPIO chip @0x00000000f7029000 registered
>> [    0.521324] pl061_gpio f702a000.gpio: PL061 GPIO chip @0x00000000f702a000 registered
>> [    0.521719] pl061_gpio f702b000.gpio: PL061 GPIO chip @0x00000000f702b000 registered
>> [    0.522107] pl061_gpio f702c000.gpio: PL061 GPIO chip @0x00000000f702c000 registered
>> [    0.522505] pl061_gpio f702d000.gpio: PL061 GPIO chip @0x00000000f702d000 registered
>> [    0.522884] pl061_gpio f702e000.gpio: PL061 GPIO chip @0x00000000f702e000 registered
>> [    0.523275] pl061_gpio f702f000.gpio: PL061 GPIO chip @0x00000000f702f000 registered
>> [    0.526086] xenfs: not registering filesystem on non-xen platform
>> [    0.528934] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
>> [    0.530124] SuperH (H)SCI(F) driver initialized
>> [    0.530364] msm_serial: driver initialized
>> [    0.536344] loop: module loaded
>> [    0.539526] hisi_sas: driver version v1.6
>> [    0.541976] libphy: Fixed MDIO Bus: probed
>> [    0.542702] tun: Universal TUN/TAP device driver, 1.6
>> [    0.542719] tun: (C) 1999-2004 Max Krasnyansky <maxk-zC7DfRvBq/JWk0Htik3J/w@public.gmane.org>
>> [    0.543688] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
>> [    0.543707] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
>> [    0.543804] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.4.0-k
>> [    0.543821] igb: Copyright (c) 2007-2014 Intel Corporation.
>> [    0.543906] igbvf: Intel(R) Gigabit Virtual Function Network Driver - version 2.4.0-k
>> [    0.543930] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
>> [    0.544018] sky2: driver version 1.30
>> [    0.544551] VFIO - User Level meta-driver version: 0.3
>> [    0.546560] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
>> [    0.546590] ehci-pci: EHCI PCI platform driver
>> [    0.546638] ehci-platform: EHCI generic platform driver
>> [    0.546730] ehci-exynos: EHCI EXYNOS driver
>> [    0.546802] ehci-msm: Qualcomm On-Chip EHCI Host Controller
>> [    0.546866] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
>> [    0.546900] ohci-pci: OHCI PCI platform driver
>> [    0.546952] ohci-platform: OHCI generic platform driver
>> [    0.547024] ohci-exynos: OHCI EXYNOS driver
>> [    0.547324] usbcore: registered new interface driver usb-storage
>> [    0.547863] file system registered
>> [    0.548183] mousedev: PS/2 mouse device common for all mice
>> [    0.548621] input: HISI 65xx PowerOn Key as /devices/platform/f8000000.pmic/hi65xx-powerkey.0.auto/input/input0
>> [    0.549253] rtc-pl031 f8003000.rtc: rtc core: registered pl031 as rtc0
>> [    0.549459] rtc-pl031 f8004000.rtc: rtc core: registered pl031 as rtc1
>> [    0.549796] i2c /dev entries driver
>> [    0.552183] sdhci: Secure Digital Host Controller Interface driver
>> [    0.552207] sdhci: Copyright(c) Pierre Ossman
>> [    0.552403] Synopsys Designware Multimedia Card Interface Driver
>> [    0.553405] sdhci-pltfm: SDHCI platform and OF driver helper
>> [    0.554851] ledtrig-cpu: registered to indicate activity on CPUs
>> [    0.555695] usbcore: registered new interface driver usbhid
>> [    0.555717] usbhid: USB HID core driver
>> [    0.557233] NET: Registered protocol family 17
>> [    0.557320] 9pnet: Installing 9P2000 support
>> [    0.557383] Key type dns_resolver registered
>> [    0.557996] registered taskstats version 1
>> [    0.561690] f7111000.uart: ttyAMA1 at MMIO 0xf7111000 (irq = 8, base_baud = 0) is a PL011 rev2
>> [    0.562226] f7112000.uart: ttyAMA2 at MMIO 0xf7112000 (irq = 9, base_baud = 0) is a PL011 rev2
>> [    0.562553] f7113000.uart: ttyAMA3 at MMIO 0xf7113000 (irq = 10, base_baud = 0) is a PL011 rev2
>> [    1.916968] console [ttyAMA3] enabled
>> [    1.922080] ssp-pl022 f7106000.spi: ARM PL022 driver, device ID: 0x00041022
>> [    1.929144] ssp-pl022 f7106000.spi: mapped registers from 0x00000000f7106000 to ffff000008f03000
>> [    1.938007] ssp-pl022 f7106000.spi: Failed to work in dma mode, work without dma!
>> [    1.949535] f72c0000.usb supply vusb_d not found, using dummy regulator
>> [    1.956256] f72c0000.usb supply vusb_a not found, using dummy regulator
>> [    2.344873] dwc2 f72c0000.usb: EPs: 16, dedicated fifos, 1920 entries in SPRAM
>> [    2.353154] dwc2 f72c0000.usb: DWC OTG Controller
>> [    2.357891] dwc2 f72c0000.usb: new USB bus registered, assigned bus number 1
>> [    2.364979] dwc2 f72c0000.usb: irq 38, io mem 0x00000000
>> [    2.371082] hub 1-0:1.0: USB hub found
>> [    2.374866] hub 1-0:1.0: 1 port detected
>> [    2.382071] rtc-pl031 f8003000.rtc: setting system clock to 1970-01-01 00:00:19 UTC (19)
>> [    2.390486] LDO2_2V8: disabling
>> [    2.393639] LDO7_SDIO: disabling
>> [    2.396900] LDO10_2V85: disabling
>> [    2.400234] LDO13_1V8: disabling
>> [    2.403476] LDO14_2V8: disabling
>> [    2.406721] LDO17_2V5: disabling
>> [    2.409956] LDO19_3V0: disabling
>> [    2.413199] wlan-en-regulator: disabling
>> [    2.417135] ALSA device list:
>> [    2.420109]   No soundcards found.
>> [    2.423712] uart-pl011 f7113000.uart: no DMA platform data
>> [    2.429585] Freeing unused kernel memory: 1024K (ffff800000c40000 - ffff800000d40000)
>> Loading, please wait...
>> starting version 228
>> [    2.479981] random: systemd-udevd: uninitialized urandom read (16 bytes read)
>> [    2.483570] random: udevadm: uninitialized urandom read (16 bytes read)
>> [    2.483680] random: udevadm: uninitialized urandom read (16 bytes read)
>> [    2.485404] random: udevadm: uninitialized urandom read (16 bytes read)
>> [    2.485631] random: udevadm: uninitialized urandom read (16 bytes read)
>> [    2.485859] random: udevadm: uninitialized urandom read (16 bytes read)
>> [    2.486098] random: udevadm: uninitialized urandom read (16 bytes read)
>> [    2.486305] random: udevadm: uninitialized urandom read (16 bytes read)
>> [    2.486729] random: udevadm: uninitialized urandom read (16 bytes read)
>> [    2.486951] random: udevadm: uninitialized urandom read (16 bytes read)
>> Begin: Loading essential drivers ... done.
>> Begin: Running /scripts/init-premount ... done.
>> Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
>> Begin: Running /scripts/local-premount ... modprobe: can't change directory to '4.9.0-rc1-00251-g323792f': No such file or directory
>> done.
>> Begin: Waiting for root file system ... Begin: Running /scripts/local-block ... done.
>> Begin: Running /scripts/local-block ... done.
>> Begin: Running /scripts/local-block ... done.
>> Begin: Running /scripts/local-block ... done.
>> Begin: Running /scripts/local-block ... done.
>> Begin: Running /scripts/local-block ... done.
>> Begin: Running /scripts/local-block ... done.
>>
>> Thanks,
>> Leo Yan
>>
>>
>>
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH 00/10] staging: iio: tsl2583: staging cleanups
From: Brian Masney @ 2016-10-28 10:00 UTC (permalink / raw)
  To: jic23, linux-iio
  Cc: devel, devicetree, lars, gregkh, linux-kernel, robh+dt, pmeerw,
	knaack.h, Mark.Rutland

This patch set begins cleaning up some of the major items that is
keeping the tsl2583 driver out of mainline. Highlights include device
tree support, converts the driver over to use the iio_chan_spec,
improved error handling, and fixes for some concurrency issues. There
is more work required to get this driver out of staging that I will
send later as a separate patch set.

Driver was tested using a TSL2581 hooked up to a Raspberry Pi 2.

The sysfs attributes were previously prefixed with illuminance0_ however
they are now prefixed with in_illuminance_. None of the IIO light
drivers in mainline have their sysfs attributes prefixed with
illuminance0_, however 8 of the IIO light drivers in mainline use the
in_illuminance_ prefix so I assume that this is the naming convention
that should be used for this driver as well.

sysfs attribute names before this patch set:

raspberrypi:/sys/bus/iio/devices/iio:device0$ ls -l
total 0
-r--r--r-- 1 root root 4096 Oct 27 20:27 dev
-rw-r--r-- 1 root root 4096 Oct 27 20:27 illuminance0_calibbias
--w------- 1 root root 4096 Oct 27 20:27 illuminance0_calibrate
-rw-r--r-- 1 root root 4096 Oct 27 20:27 illuminance0_calibscale
-r--r--r-- 1 root root 4096 Oct 27 20:27 illuminance0_calibscale_available
-r--r--r-- 1 root root 4096 Oct 27 20:27 illuminance0_input
-rw-r--r-- 1 root root 4096 Oct 27 20:27 illuminance0_input_target
-rw-r--r-- 1 root root 4096 Oct 27 20:27 illuminance0_integration_time
-r--r--r-- 1 root root 4096 Oct 27 20:27 illuminance0_integration_time_available
-rw-r--r-- 1 root root 4096 Oct 27 20:27 illuminance0_lux_table
-r--r--r-- 1 root root 4096 Oct 27 20:27 name
lrwxrwxrwx 1 root root    0 Oct 27 20:27 of_node ->
 ../../../../../../../firmware/devicetree/base/soc/i2c@7e804000/tsl2581@29/
drwxr-xr-x 2 root root    0 Oct 27 20:27 power/
-rw-r--r-- 1 root root 4096 Oct 27 20:27 power_state
lrwxrwxrwx 1 root root    0 Oct 27 20:27 subsystem -> ../../../../../../../bus/iio/
-rw-r--r-- 1 root root 4096 Oct 27 20:27 uevent

sysfs attribute names after this patch set:

raspberrypi:/sys/bus/iio/devices/iio:device0$ ls -l
total 0
-r--r--r-- 1 root root 4096 Oct 27 22:29 dev
-rw-r--r-- 1 root root 4096 Oct 27 22:29 in_illuminance_both_raw
-rw-r--r-- 1 root root 4096 Oct 27 22:29 in_illuminance_calibbias
--w------- 1 root root 4096 Oct 27 22:29 in_illuminance_calibrate
-rw-r--r-- 1 root root 4096 Oct 27 22:29 in_illuminance_calibscale
-r--r--r-- 1 root root 4096 Oct 27 22:29 in_illuminance_calibscale_available
-rw-r--r-- 1 root root 4096 Oct 27 22:29 in_illuminance_input
-rw-r--r-- 1 root root 4096 Oct 27 22:29 in_illuminance_input_target
-rw-r--r-- 1 root root 4096 Oct 27 22:29 in_illuminance_integration_time
-r--r--r-- 1 root root 4096 Oct 27 22:29 in_illuminance_integration_time_available
-rw-r--r-- 1 root root 4096 Oct 27 22:29 in_illuminance_ir_raw
-rw-r--r-- 1 root root 4096 Oct 27 22:29 in_illuminance_lux_table
-r--r--r-- 1 root root 4096 Oct 27 22:29 name
lrwxrwxrwx 1 root root    0 Oct 27 22:29 of_node ->
 ../../../../../../../firmware/devicetree/base/soc/i2c@7e804000/tsl2581@29/
drwxr-xr-x 2 root root    0 Oct 27 22:29 power/
lrwxrwxrwx 1 root root    0 Oct 27 22:29 subsystem ->
 ../../../../../../../bus/iio/
-rw-r--r-- 1 root root 4096 Oct 27 22:23 uevent

Brian Masney (10):
  staging: iio: tsl2583: add of_match table for device tree support
  staging: iio: tsl2583: check for error code from i2c_smbus_read_byte()
  staging: iio: tsl2583: return proper error code instead of -1
  staging: iio: tsl2583: remove redundant power_state sysfs attribute
  staging: iio: tsl2583: check return values from taos_chip_{on,off}
  staging: iio: tsl2583: convert to use iio_chan_spec and
    {read,write}_raw
  staging: iio: tsl2583: convert illuminance0_calibscale sysfs attr to
    use iio_chan_spec
  staging: iio: tsl2583: use IIO_*_ATTR* macros to create sysfs entries
  staging: iio: tsl2583: add error code to sysfs store functions
  staging: iio: tsl2583: add locking to sysfs attributes

 .../devicetree/bindings/iio/light/tsl2583.txt      |  26 ++
 drivers/staging/iio/light/tsl2583.c                | 509 +++++++++++----------
 2 files changed, 288 insertions(+), 247 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/iio/light/tsl2583.txt

-- 
2.7.4

^ permalink raw reply

* [PATCH 01/10] staging: iio: tsl2583: add of_match table for device tree support
From: Brian Masney @ 2016-10-28 10:00 UTC (permalink / raw)
  To: jic23, linux-iio
  Cc: devel, devicetree, lars, gregkh, linux-kernel, robh+dt, pmeerw,
	knaack.h, Mark.Rutland
In-Reply-To: <1477648821-3786-1-git-send-email-masneyb@onstation.org>

Add device tree support for the tsl2583 IIO driver with no custom
properties.

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 .../devicetree/bindings/iio/light/tsl2583.txt      | 26 ++++++++++++++++++++++
 drivers/staging/iio/light/tsl2583.c                | 13 +++++++++++
 2 files changed, 39 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/light/tsl2583.txt

diff --git a/Documentation/devicetree/bindings/iio/light/tsl2583.txt b/Documentation/devicetree/bindings/iio/light/tsl2583.txt
new file mode 100644
index 0000000..8e2066c
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/light/tsl2583.txt
@@ -0,0 +1,26 @@
+* TAOS TSL 2580/2581/2583 ALS sensor
+
+Required properties:
+
+  - compatible: Should be one of
+		"amstaos,tsl2580"
+		"amstaos,tsl2581"
+		"amstaos,tsl2583"
+  - reg: the I2C address of the device
+
+Optional properties:
+
+  - interrupt-parent: should be the phandle for the interrupt controller
+  - interrupts: the sole interrupt generated by the device
+
+  Refer to interrupt-controller/interrupts.txt for generic interrupt client
+  node bindings.
+
+  - vcc-supply: phandle to the regulator that provides power to the sensor.
+
+Example:
+
+tsl2581@29 {
+	compatible = "amstaos,tsl2581";
+	reg = <0x29>;
+};
diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
index 08f1583..fd4b6ef 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -947,11 +947,24 @@ static struct i2c_device_id taos_idtable[] = {
 };
 MODULE_DEVICE_TABLE(i2c, taos_idtable);
 
+#ifdef CONFIG_OF
+static const struct of_device_id taos2583_of_match[] = {
+	{ .compatible = "amstaos,tsl2580", },
+	{ .compatible = "amstaos,tsl2581", },
+	{ .compatible = "amstaos,tsl2583", },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, taos2583_of_match);
+#else
+#define taos2583_of_match NULL
+#endif
+
 /* Driver definition */
 static struct i2c_driver taos_driver = {
 	.driver = {
 		.name = "tsl2583",
 		.pm = TAOS_PM_OPS,
+		.of_match_table = taos2583_of_match,
 	},
 	.id_table = taos_idtable,
 	.probe = taos_probe,
-- 
2.7.4

^ permalink raw reply related

* [PATCH 02/10] staging: iio: tsl2583: check for error code from i2c_smbus_read_byte()
From: Brian Masney @ 2016-10-28 10:00 UTC (permalink / raw)
  To: jic23, linux-iio
  Cc: devel, devicetree, lars, gregkh, linux-kernel, robh+dt, pmeerw,
	knaack.h, Mark.Rutland
In-Reply-To: <1477648821-3786-1-git-send-email-masneyb@onstation.org>

taos_i2c_read() and taos_als_calibrate() does not check to see if the
value returned by i2c_smbus_read_byte() was an error code. This patch
adds the appropriate error handling.

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 drivers/staging/iio/light/tsl2583.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
index fd4b6ef..35c1696 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -171,7 +171,14 @@ taos_i2c_read(struct i2c_client *client, u8 reg, u8 *val, unsigned int len)
 			return ret;
 		}
 		/* read the data */
-		*val = i2c_smbus_read_byte(client);
+		ret = i2c_smbus_read_byte(client);
+		if (ret < 0) {
+			dev_err(&client->dev,
+				"%s failed to read byte after writing to register %x\n",
+				__func__, reg);
+			return ret;
+		}
+		*val = ret;
 		val++;
 		reg++;
 	}
@@ -355,6 +362,13 @@ static int taos_als_calibrate(struct iio_dev *indio_dev)
 	}
 
 	reg_val = i2c_smbus_read_byte(chip->client);
+	if (reg_val < 0) {
+		dev_err(&chip->client->dev,
+			"%s failed to read after writing to the CNTRL register\n",
+			__func__);
+		return ret;
+	}
+
 	if ((reg_val & (TSL258X_CNTL_ADC_ENBL | TSL258X_CNTL_PWR_ON))
 			!= (TSL258X_CNTL_ADC_ENBL | TSL258X_CNTL_PWR_ON)) {
 		dev_err(&chip->client->dev,
@@ -371,6 +385,12 @@ static int taos_als_calibrate(struct iio_dev *indio_dev)
 		return ret;
 	}
 	reg_val = i2c_smbus_read_byte(chip->client);
+	if (reg_val < 0) {
+		dev_err(&chip->client->dev,
+			"%s failed to read after writing to the STATUS register\n",
+			__func__);
+		return ret;
+	}
 
 	if ((reg_val & TSL258X_STA_ADC_VALID) != TSL258X_STA_ADC_VALID) {
 		dev_err(&chip->client->dev,
-- 
2.7.4

^ permalink raw reply related

* [PATCH 03/10] staging: iio: tsl2583: return proper error code instead of -1
From: Brian Masney @ 2016-10-28 10:00 UTC (permalink / raw)
  To: jic23, linux-iio
  Cc: devel, devicetree, lars, gregkh, linux-kernel, robh+dt, pmeerw,
	knaack.h, Mark.Rutland
In-Reply-To: <1477648821-3786-1-git-send-email-masneyb@onstation.org>

taos_als_calibrate() has a code path where -1 is returned. This patch
changes the code so that a proper error code is returned.

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 drivers/staging/iio/light/tsl2583.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
index 35c1696..47fd373 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -373,7 +373,7 @@ static int taos_als_calibrate(struct iio_dev *indio_dev)
 			!= (TSL258X_CNTL_ADC_ENBL | TSL258X_CNTL_PWR_ON)) {
 		dev_err(&chip->client->dev,
 			"taos_als_calibrate failed: device not powered on with ADC enabled\n");
-		return -1;
+		return -EINVAL;
 	}
 
 	ret = i2c_smbus_write_byte(chip->client,
-- 
2.7.4

^ permalink raw reply related

* [PATCH 04/10] staging: iio: tsl2583: remove redundant power_state sysfs attribute
From: Brian Masney @ 2016-10-28 10:00 UTC (permalink / raw)
  To: jic23, linux-iio
  Cc: devel, devicetree, lars, gregkh, linux-kernel, robh+dt, pmeerw,
	knaack.h, Mark.Rutland
In-Reply-To: <1477648821-3786-1-git-send-email-masneyb@onstation.org>

IIO devices have a /sys/bus/iio/devices/iio:deviceX/power/ directory
that allows viewing and controling various power parameters. The tsl2583
driver also has an additional custom sysfs attribute named power_state
that is not needed. This patch removes the redundant power_state sysfs
attribute.

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 drivers/staging/iio/light/tsl2583.c | 31 -------------------------------
 1 file changed, 31 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
index 47fd373..f8ccb4d 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -511,33 +511,6 @@ static int taos_chip_off(struct iio_dev *indio_dev)
 
 /* Sysfs Interface Functions */
 
-static ssize_t taos_power_state_show(struct device *dev,
-				     struct device_attribute *attr, char *buf)
-{
-	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
-	struct tsl2583_chip *chip = iio_priv(indio_dev);
-
-	return sprintf(buf, "%d\n", chip->taos_chip_status);
-}
-
-static ssize_t taos_power_state_store(struct device *dev,
-				      struct device_attribute *attr,
-				      const char *buf, size_t len)
-{
-	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
-	int value;
-
-	if (kstrtoint(buf, 0, &value))
-		return -EINVAL;
-
-	if (!value)
-		taos_chip_off(indio_dev);
-	else
-		taos_chip_on(indio_dev);
-
-	return len;
-}
-
 static ssize_t taos_gain_show(struct device *dev,
 			      struct device_attribute *attr, char *buf)
 {
@@ -785,9 +758,6 @@ static ssize_t taos_luxtable_store(struct device *dev,
 	return len;
 }
 
-static DEVICE_ATTR(power_state, S_IRUGO | S_IWUSR,
-		taos_power_state_show, taos_power_state_store);
-
 static DEVICE_ATTR(illuminance0_calibscale, S_IRUGO | S_IWUSR,
 		taos_gain_show, taos_gain_store);
 static DEVICE_ATTR(illuminance0_calibscale_available, S_IRUGO,
@@ -810,7 +780,6 @@ static DEVICE_ATTR(illuminance0_lux_table, S_IRUGO | S_IWUSR,
 		taos_luxtable_show, taos_luxtable_store);
 
 static struct attribute *sysfs_attrs_ctrl[] = {
-	&dev_attr_power_state.attr,
 	&dev_attr_illuminance0_calibscale.attr,			/* Gain  */
 	&dev_attr_illuminance0_calibscale_available.attr,
 	&dev_attr_illuminance0_integration_time.attr,	/* I time*/
-- 
2.7.4

^ permalink raw reply related

* [PATCH 05/10] staging: iio: tsl2583: check return values from taos_chip_{on, off}
From: Brian Masney @ 2016-10-28 10:00 UTC (permalink / raw)
  To: jic23, linux-iio
  Cc: devel, devicetree, lars, gregkh, linux-kernel, robh+dt, pmeerw,
	knaack.h, Mark.Rutland
In-Reply-To: <1477648821-3786-1-git-send-email-masneyb@onstation.org>

The return value from taos_chip_on() and taos_chip_off() was not
checked in taos_luxtable_store() and taos_probe(). This patch adds
proper error checking to these function calls.

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 drivers/staging/iio/light/tsl2583.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
index f8ccb4d..e975bba 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -727,7 +727,7 @@ static ssize_t taos_luxtable_store(struct device *dev,
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct tsl2583_chip *chip = iio_priv(indio_dev);
 	int value[ARRAY_SIZE(taos_device_lux) * 3 + 1];
-	int n;
+	int n, ret = -EINVAL;
 
 	get_options(buf, ARRAY_SIZE(value), value);
 
@@ -739,23 +739,31 @@ static ssize_t taos_luxtable_store(struct device *dev,
 	n = value[0];
 	if ((n % 3) || n < 6 || n > ((ARRAY_SIZE(taos_device_lux) - 1) * 3)) {
 		dev_info(dev, "LUX TABLE INPUT ERROR 1 Value[0]=%d\n", n);
-		return -EINVAL;
+		goto done;
 	}
 	if ((value[(n - 2)] | value[(n - 1)] | value[n]) != 0) {
 		dev_info(dev, "LUX TABLE INPUT ERROR 2 Value[0]=%d\n", n);
-		return -EINVAL;
+		goto done;
 	}
 
-	if (chip->taos_chip_status == TSL258X_CHIP_WORKING)
-		taos_chip_off(indio_dev);
+	if (chip->taos_chip_status == TSL258X_CHIP_WORKING) {
+		ret = taos_chip_off(indio_dev);
+		if (ret < 0)
+			goto done;
+	}
 
 	/* Zero out the table */
 	memset(taos_device_lux, 0, sizeof(taos_device_lux));
 	memcpy(taos_device_lux, &value[1], (value[0] * 4));
 
-	taos_chip_on(indio_dev);
+	ret = taos_chip_on(indio_dev);
+	if (ret < 0)
+		goto done;
 
-	return len;
+	ret = len;
+
+done:
+	return ret;
 }
 
 static DEVICE_ATTR(illuminance0_calibscale, S_IRUGO | S_IWUSR,
@@ -883,7 +891,9 @@ static int taos_probe(struct i2c_client *clientp,
 	taos_defaults(chip);
 
 	/* Make sure the chip is on */
-	taos_chip_on(indio_dev);
+	ret = taos_chip_on(indio_dev);
+	if (ret < 0)
+		return ret;
 
 	dev_info(&clientp->dev, "Light sensor found.\n");
 	return 0;
-- 
2.7.4

^ permalink raw reply related

* [PATCH 06/10] staging: iio: tsl2583: convert to use iio_chan_spec and {read, write}_raw
From: Brian Masney @ 2016-10-28 10:00 UTC (permalink / raw)
  To: jic23, linux-iio
  Cc: devel, devicetree, lars, gregkh, linux-kernel, robh+dt, pmeerw,
	knaack.h, Mark.Rutland
In-Reply-To: <1477648821-3786-1-git-send-email-masneyb@onstation.org>

The tsl2583 driver directly creates sysfs attributes that should instead
be created by the IIO core on behalf of the driver. This patch adds the
iio_chan_spec array, the relevant info_mask elements and the read_raw()
and write_raw() functions to take advantage of features provided by the
IIO core. These sysfs attributes were migrated with this patch:
illuminance0_input, illuminance0_calibbias,
illuminance0_integration_time. This also exposes the raw values read
from the two channels on the sensor.

With this change, these four sysfs entries have their prefix changed
from illuminance0_ to in_illuminance_. This is deemed to be acceptable
since none of the IIO light drivers in mainline use the illuminance0_
prefix, however 8 of the IIO light drivers in mainline use the
in_illuminance_ prefix.

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 drivers/staging/iio/light/tsl2583.c | 236 ++++++++++++++++++++++--------------
 1 file changed, 143 insertions(+), 93 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
index e975bba..6a61a86 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -211,28 +211,23 @@ static int taos_get_lux(struct iio_dev *indio_dev)
 	u32 ch0lux = 0;
 	u32 ch1lux = 0;
 
-	if (mutex_trylock(&chip->als_mutex) == 0) {
-		dev_info(&chip->client->dev, "taos_get_lux device is busy\n");
-		return chip->als_cur_info.lux; /* busy, so return LAST VALUE */
-	}
-
 	if (chip->taos_chip_status != TSL258X_CHIP_WORKING) {
 		/* device is not enabled */
 		dev_err(&chip->client->dev, "taos_get_lux device is not enabled\n");
 		ret = -EBUSY;
-		goto out_unlock;
+		goto done;
 	}
 
 	ret = taos_i2c_read(chip->client, (TSL258X_CMD_REG), &buf[0], 1);
 	if (ret < 0) {
 		dev_err(&chip->client->dev, "taos_get_lux failed to read CMD_REG\n");
-		goto out_unlock;
+		goto done;
 	}
 	/* is data new & valid */
 	if (!(buf[0] & TSL258X_STA_ADC_INTR)) {
 		dev_err(&chip->client->dev, "taos_get_lux data not valid\n");
 		ret = chip->als_cur_info.lux; /* return LAST VALUE */
-		goto out_unlock;
+		goto done;
 	}
 
 	for (i = 0; i < 4; i++) {
@@ -243,7 +238,7 @@ static int taos_get_lux(struct iio_dev *indio_dev)
 			dev_err(&chip->client->dev,
 				"taos_get_lux failed to read register %x\n",
 				reg);
-			goto out_unlock;
+			goto done;
 		}
 	}
 
@@ -259,7 +254,7 @@ static int taos_get_lux(struct iio_dev *indio_dev)
 		dev_err(&chip->client->dev,
 			"taos_i2c_write_command failed in taos_get_lux, err = %d\n",
 			ret);
-		goto out_unlock; /* have no data, so return failure */
+		goto done; /* have no data, so return failure */
 	}
 
 	/* extract ALS/lux data */
@@ -276,7 +271,7 @@ static int taos_get_lux(struct iio_dev *indio_dev)
 		/* have no data, so return LAST VALUE */
 		ret = 0;
 		chip->als_cur_info.lux = 0;
-		goto out_unlock;
+		goto done;
 	}
 	/* calculate ratio */
 	ratio = (ch1 << 15) / ch0;
@@ -302,7 +297,7 @@ static int taos_get_lux(struct iio_dev *indio_dev)
 		dev_dbg(&chip->client->dev, "No Data - Return last value\n");
 		ret = 0;
 		chip->als_cur_info.lux = 0;
-		goto out_unlock;
+		goto done;
 	}
 
 	/* adjust for active time scale */
@@ -334,8 +329,7 @@ static int taos_get_lux(struct iio_dev *indio_dev)
 	chip->als_cur_info.lux = lux;
 	ret = lux;
 
-out_unlock:
-	mutex_unlock(&chip->als_mutex);
+done:
 	return ret;
 }
 
@@ -575,69 +569,12 @@ static ssize_t taos_gain_available_show(struct device *dev,
 	return sprintf(buf, "%s\n", "1 8 16 111");
 }
 
-static ssize_t taos_als_time_show(struct device *dev,
-				  struct device_attribute *attr, char *buf)
-{
-	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
-	struct tsl2583_chip *chip = iio_priv(indio_dev);
-
-	return sprintf(buf, "%d\n", chip->taos_settings.als_time);
-}
-
-static ssize_t taos_als_time_store(struct device *dev,
-				   struct device_attribute *attr,
-				   const char *buf, size_t len)
-{
-	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
-	struct tsl2583_chip *chip = iio_priv(indio_dev);
-	int value;
-
-	if (kstrtoint(buf, 0, &value))
-		return -EINVAL;
-
-	if ((value < 50) || (value > 650))
-		return -EINVAL;
-
-	if (value % 50)
-		return -EINVAL;
-
-	chip->taos_settings.als_time = value;
-
-	return len;
-}
-
 static ssize_t taos_als_time_available_show(struct device *dev,
 					    struct device_attribute *attr,
 					    char *buf)
 {
 	return sprintf(buf, "%s\n",
-		"50 100 150 200 250 300 350 400 450 500 550 600 650");
-}
-
-static ssize_t taos_als_trim_show(struct device *dev,
-				  struct device_attribute *attr, char *buf)
-{
-	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
-	struct tsl2583_chip *chip = iio_priv(indio_dev);
-
-	return sprintf(buf, "%d\n", chip->taos_settings.als_gain_trim);
-}
-
-static ssize_t taos_als_trim_store(struct device *dev,
-				   struct device_attribute *attr,
-				   const char *buf, size_t len)
-{
-	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
-	struct tsl2583_chip *chip = iio_priv(indio_dev);
-	int value;
-
-	if (kstrtoint(buf, 0, &value))
-		return -EINVAL;
-
-	if (value)
-		chip->taos_settings.als_gain_trim = value;
-
-	return len;
+		"0.000050 0.000100 0.000150 0.000200 0.000250 0.000300 0.000350 0.000400 0.000450 0.000500 0.000550 0.000600 0.000650");
 }
 
 static ssize_t taos_als_cal_target_show(struct device *dev,
@@ -667,18 +604,6 @@ static ssize_t taos_als_cal_target_store(struct device *dev,
 	return len;
 }
 
-static ssize_t taos_lux_show(struct device *dev, struct device_attribute *attr,
-			     char *buf)
-{
-	int ret;
-
-	ret = taos_get_lux(dev_to_iio_dev(dev));
-	if (ret < 0)
-		return ret;
-
-	return sprintf(buf, "%d\n", ret);
-}
-
 static ssize_t taos_do_calibrate(struct device *dev,
 				 struct device_attribute *attr,
 				 const char *buf, size_t len)
@@ -771,18 +696,12 @@ static DEVICE_ATTR(illuminance0_calibscale, S_IRUGO | S_IWUSR,
 static DEVICE_ATTR(illuminance0_calibscale_available, S_IRUGO,
 		taos_gain_available_show, NULL);
 
-static DEVICE_ATTR(illuminance0_integration_time, S_IRUGO | S_IWUSR,
-		taos_als_time_show, taos_als_time_store);
 static DEVICE_ATTR(illuminance0_integration_time_available, S_IRUGO,
 		taos_als_time_available_show, NULL);
 
-static DEVICE_ATTR(illuminance0_calibbias, S_IRUGO | S_IWUSR,
-		taos_als_trim_show, taos_als_trim_store);
-
 static DEVICE_ATTR(illuminance0_input_target, S_IRUGO | S_IWUSR,
 		taos_als_cal_target_show, taos_als_cal_target_store);
 
-static DEVICE_ATTR(illuminance0_input, S_IRUGO, taos_lux_show, NULL);
 static DEVICE_ATTR(illuminance0_calibrate, S_IWUSR, NULL, taos_do_calibrate);
 static DEVICE_ATTR(illuminance0_lux_table, S_IRUGO | S_IWUSR,
 		taos_luxtable_show, taos_luxtable_store);
@@ -790,11 +709,8 @@ static DEVICE_ATTR(illuminance0_lux_table, S_IRUGO | S_IWUSR,
 static struct attribute *sysfs_attrs_ctrl[] = {
 	&dev_attr_illuminance0_calibscale.attr,			/* Gain  */
 	&dev_attr_illuminance0_calibscale_available.attr,
-	&dev_attr_illuminance0_integration_time.attr,	/* I time*/
 	&dev_attr_illuminance0_integration_time_available.attr,
-	&dev_attr_illuminance0_calibbias.attr,			/* trim  */
 	&dev_attr_illuminance0_input_target.attr,
-	&dev_attr_illuminance0_input.attr,
 	&dev_attr_illuminance0_calibrate.attr,
 	&dev_attr_illuminance0_lux_table.attr,
 	NULL
@@ -810,9 +726,141 @@ static int taos_tsl258x_device(unsigned char *bufp)
 	return ((bufp[TSL258X_CHIPID] & 0xf0) == 0x90);
 }
 
+static const struct iio_chan_spec tsl2583_channels[] = {
+	{
+		.type = IIO_LIGHT,
+		.modified = 1,
+		.channel2 = IIO_MOD_LIGHT_IR,
+		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
+	},
+	{
+		.type = IIO_LIGHT,
+		.modified = 1,
+		.channel2 = IIO_MOD_LIGHT_BOTH,
+		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
+	},
+	{
+		.type = IIO_LIGHT,
+		.info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED) |
+				      BIT(IIO_CHAN_INFO_CALIBBIAS) |
+				      BIT(IIO_CHAN_INFO_INT_TIME),
+	},
+};
+
+static int tsl2583_read_raw(struct iio_dev *indio_dev,
+			    struct iio_chan_spec const *chan,
+			    int *val, int *val2, long mask)
+{
+	struct tsl2583_chip *chip = iio_priv(indio_dev);
+	int ret = -EINVAL;
+
+	mutex_lock(&chip->als_mutex);
+
+	if (chip->taos_chip_status != TSL258X_CHIP_WORKING) {
+		ret = -EBUSY;
+		goto read_done;
+	}
+
+	switch (mask) {
+	case IIO_CHAN_INFO_RAW:
+		if (chan->type == IIO_LIGHT) {
+			ret = taos_get_lux(indio_dev);
+			if (ret < 0)
+				goto read_done;
+
+			/*
+			 * From page 20 of the TSL2581, TSL2583 data
+			 * sheet (TAOS134 − MARCH 2011):
+			 *
+			 * One of the photodiodes (channel 0) is
+			 * sensitive to both visible and infrared light,
+			 * while the second photodiode (channel 1) is
+			 * sensitive primarily to infrared light.
+			 */
+			if (chan->channel2 == IIO_MOD_LIGHT_BOTH)
+				*val = chip->als_cur_info.als_ch0;
+			else
+				*val = chip->als_cur_info.als_ch1;
+
+			ret = IIO_VAL_INT;
+		}
+		break;
+	case IIO_CHAN_INFO_PROCESSED:
+		if (chan->type == IIO_LIGHT) {
+			ret = taos_get_lux(indio_dev);
+			if (ret < 0)
+				goto read_done;
+
+			*val = ret;
+			ret = IIO_VAL_INT;
+		}
+		break;
+	case IIO_CHAN_INFO_CALIBBIAS:
+		if (chan->type == IIO_LIGHT) {
+			*val = chip->taos_settings.als_gain_trim;
+			ret = IIO_VAL_INT;
+		}
+		break;
+	case IIO_CHAN_INFO_INT_TIME:
+		if (chan->type == IIO_LIGHT) {
+			*val = 0;
+			*val2 = chip->taos_settings.als_time;
+			ret = IIO_VAL_INT_PLUS_MICRO;
+		}
+		break;
+	default:
+		break;
+	}
+
+read_done:
+	mutex_unlock(&chip->als_mutex);
+
+	return ret;
+}
+
+static int tsl2583_write_raw(struct iio_dev *indio_dev,
+			     struct iio_chan_spec const *chan,
+			     int val, int val2, long mask)
+{
+	struct tsl2583_chip *chip = iio_priv(indio_dev);
+	int ret = -EINVAL;
+
+	mutex_lock(&chip->als_mutex);
+
+	if (chip->taos_chip_status != TSL258X_CHIP_WORKING) {
+		ret = -EBUSY;
+		goto write_done;
+	}
+
+	switch (mask) {
+	case IIO_CHAN_INFO_CALIBBIAS:
+		if (chan->type == IIO_LIGHT) {
+			chip->taos_settings.als_gain_trim = val;
+			ret = 0;
+		}
+		break;
+	case IIO_CHAN_INFO_INT_TIME:
+		if (chan->type == IIO_LIGHT && !val && val2 >= 50 &&
+		    val2 <= 650 && !(val2 % 50)) {
+			chip->taos_settings.als_time = val2;
+			ret = 0;
+		}
+		break;
+	default:
+		break;
+	}
+
+write_done:
+	mutex_unlock(&chip->als_mutex);
+
+	return ret;
+}
+
 static const struct iio_info tsl2583_info = {
 	.attrs = &tsl2583_attribute_group,
 	.driver_module = THIS_MODULE,
+	.read_raw = tsl2583_read_raw,
+	.write_raw = tsl2583_write_raw,
 };
 
 /*
@@ -878,6 +926,8 @@ static int taos_probe(struct i2c_client *clientp,
 	}
 
 	indio_dev->info = &tsl2583_info;
+	indio_dev->channels = tsl2583_channels;
+	indio_dev->num_channels = ARRAY_SIZE(tsl2583_channels);
 	indio_dev->dev.parent = &clientp->dev;
 	indio_dev->modes = INDIO_DIRECT_MODE;
 	indio_dev->name = chip->client->name;
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related

* [PATCH 07/10] staging: iio: tsl2583: convert illuminance0_calibscale sysfs attr to use iio_chan_spec
From: Brian Masney @ 2016-10-28 10:00 UTC (permalink / raw)
  To: jic23, linux-iio
  Cc: devel, devicetree, lars, gregkh, linux-kernel, robh+dt, pmeerw,
	knaack.h, Mark.Rutland
In-Reply-To: <1477648821-3786-1-git-send-email-masneyb@onstation.org>

The illuminance0_calibscale sysfs attribute is not currently created by
the IIO core. This patch adds the appropriate mask to iio_chan_spec,
along with the appropriate data handling in the read_raw() and
write_raw() functions, so that the sysfs attribute is created by the IIO
core. With this change, this sysfs entry will have its prefix changed
from illuminance0_ to in_illuminance_.

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 drivers/staging/iio/light/tsl2583.c | 89 +++++++++++--------------------------
 1 file changed, 25 insertions(+), 64 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
index 6a61a86..bfff6ca 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -124,14 +124,15 @@ static struct taos_lux taos_device_lux[11] = {
 struct gainadj {
 	s16 ch0;
 	s16 ch1;
+	s16 mean;
 };
 
 /* Index = (0 - 3) Used to validate the gain selection index */
 static const struct gainadj gainadj[] = {
-	{ 1, 1 },
-	{ 8, 8 },
-	{ 16, 16 },
-	{ 107, 115 }
+	{ 1, 1, 1 },
+	{ 8, 8, 8 },
+	{ 16, 16, 16 },
+	{ 107, 115, 111 }
 };
 
 /*
@@ -505,63 +506,6 @@ static int taos_chip_off(struct iio_dev *indio_dev)
 
 /* Sysfs Interface Functions */
 
-static ssize_t taos_gain_show(struct device *dev,
-			      struct device_attribute *attr, char *buf)
-{
-	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
-	struct tsl2583_chip *chip = iio_priv(indio_dev);
-	char gain[4] = {0};
-
-	switch (chip->taos_settings.als_gain) {
-	case 0:
-		strcpy(gain, "001");
-		break;
-	case 1:
-		strcpy(gain, "008");
-		break;
-	case 2:
-		strcpy(gain, "016");
-		break;
-	case 3:
-		strcpy(gain, "111");
-		break;
-	}
-
-	return sprintf(buf, "%s\n", gain);
-}
-
-static ssize_t taos_gain_store(struct device *dev,
-			       struct device_attribute *attr,
-			       const char *buf, size_t len)
-{
-	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
-	struct tsl2583_chip *chip = iio_priv(indio_dev);
-	int value;
-
-	if (kstrtoint(buf, 0, &value))
-		return -EINVAL;
-
-	switch (value) {
-	case 1:
-		chip->taos_settings.als_gain = 0;
-		break;
-	case 8:
-		chip->taos_settings.als_gain = 1;
-		break;
-	case 16:
-		chip->taos_settings.als_gain = 2;
-		break;
-	case 111:
-		chip->taos_settings.als_gain = 3;
-		break;
-	default:
-		dev_err(dev, "Invalid Gain Index (must be 1,8,16,111)\n");
-		return -1;
-	}
-
-	return len;
-}
-
 static ssize_t taos_gain_available_show(struct device *dev,
 					struct device_attribute *attr,
 					char *buf)
@@ -691,8 +635,6 @@ static ssize_t taos_luxtable_store(struct device *dev,
 	return ret;
 }
 
-static DEVICE_ATTR(illuminance0_calibscale, S_IRUGO | S_IWUSR,
-		taos_gain_show, taos_gain_store);
 static DEVICE_ATTR(illuminance0_calibscale_available, S_IRUGO,
 		taos_gain_available_show, NULL);
 
@@ -707,7 +649,6 @@ static DEVICE_ATTR(illuminance0_lux_table, S_IRUGO | S_IWUSR,
 		taos_luxtable_show, taos_luxtable_store);
 
 static struct attribute *sysfs_attrs_ctrl[] = {
-	&dev_attr_illuminance0_calibscale.attr,			/* Gain  */
 	&dev_attr_illuminance0_calibscale_available.attr,
 	&dev_attr_illuminance0_integration_time_available.attr,
 	&dev_attr_illuminance0_input_target.attr,
@@ -743,6 +684,7 @@ static const struct iio_chan_spec tsl2583_channels[] = {
 		.type = IIO_LIGHT,
 		.info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED) |
 				      BIT(IIO_CHAN_INFO_CALIBBIAS) |
+				      BIT(IIO_CHAN_INFO_CALIBSCALE) |
 				      BIT(IIO_CHAN_INFO_INT_TIME),
 	},
 };
@@ -801,6 +743,12 @@ static int tsl2583_read_raw(struct iio_dev *indio_dev,
 			ret = IIO_VAL_INT;
 		}
 		break;
+	case IIO_CHAN_INFO_CALIBSCALE:
+		if (chan->type == IIO_LIGHT) {
+			*val = gainadj[chip->taos_settings.als_gain].mean;
+			ret = IIO_VAL_INT;
+		}
+		break;
 	case IIO_CHAN_INFO_INT_TIME:
 		if (chan->type == IIO_LIGHT) {
 			*val = 0;
@@ -839,6 +787,19 @@ static int tsl2583_write_raw(struct iio_dev *indio_dev,
 			ret = 0;
 		}
 		break;
+	case IIO_CHAN_INFO_CALIBSCALE:
+		if (chan->type == IIO_LIGHT) {
+			int i;
+
+			for (i = 0; i < ARRAY_SIZE(gainadj); i++) {
+				if (gainadj[i].mean == val) {
+					chip->taos_settings.als_gain = i;
+					ret = 0;
+					break;
+				}
+			}
+		}
+		break;
 	case IIO_CHAN_INFO_INT_TIME:
 		if (chan->type == IIO_LIGHT && !val && val2 >= 50 &&
 		    val2 <= 650 && !(val2 % 50)) {
-- 
2.7.4

^ permalink raw reply related

* [PATCH 08/10] staging: iio: tsl2583: use IIO_*_ATTR* macros to create sysfs entries
From: Brian Masney @ 2016-10-28 10:00 UTC (permalink / raw)
  To: jic23, linux-iio
  Cc: devel, devicetree, lars, gregkh, linux-kernel, robh+dt, pmeerw,
	knaack.h, Mark.Rutland
In-Reply-To: <1477648821-3786-1-git-send-email-masneyb@onstation.org>

Use the IIO_CONST_ATTR, IIO_DEVICE_ATTR_RW, and IIO_DEVICE_ATTR_WO
macros for creating the in_illuminance_calibscale_available,
in_illuminance_integration_time_available, in_illuminance_input_target,
in_illuminance_calibrate, and in_illuminance_lux_table sysfs entries.
Previously these sysfs entries were prefixed with illuminance0_, however
they are now prefixed with in_illuminance_ to make these sysfs entries
consistent with how the IIO core is creating the other sysfs entries.

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 drivers/staging/iio/light/tsl2583.c | 73 ++++++++++++++-----------------------
 1 file changed, 27 insertions(+), 46 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
index bfff6ca..1462374 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -29,6 +29,7 @@
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/iio/iio.h>
+#include <linux/iio/sysfs.h>
 
 #define TSL258X_MAX_DEVICE_REGS		32
 
@@ -506,24 +507,9 @@ static int taos_chip_off(struct iio_dev *indio_dev)
 
 /* Sysfs Interface Functions */
 
-static ssize_t taos_gain_available_show(struct device *dev,
-					struct device_attribute *attr,
-					char *buf)
-{
-	return sprintf(buf, "%s\n", "1 8 16 111");
-}
-
-static ssize_t taos_als_time_available_show(struct device *dev,
-					    struct device_attribute *attr,
-					    char *buf)
-{
-	return sprintf(buf, "%s\n",
-		"0.000050 0.000100 0.000150 0.000200 0.000250 0.000300 0.000350 0.000400 0.000450 0.000500 0.000550 0.000600 0.000650");
-}
-
-static ssize_t taos_als_cal_target_show(struct device *dev,
-					struct device_attribute *attr,
-					char *buf)
+static ssize_t in_illuminance_input_target_show(struct device *dev,
+						struct device_attribute *attr,
+						char *buf)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct tsl2583_chip *chip = iio_priv(indio_dev);
@@ -531,9 +517,9 @@ static ssize_t taos_als_cal_target_show(struct device *dev,
 	return sprintf(buf, "%d\n", chip->taos_settings.als_cal_target);
 }
 
-static ssize_t taos_als_cal_target_store(struct device *dev,
-					 struct device_attribute *attr,
-					 const char *buf, size_t len)
+static ssize_t in_illuminance_input_target_store(struct device *dev,
+						 struct device_attribute *attr,
+						 const char *buf, size_t len)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct tsl2583_chip *chip = iio_priv(indio_dev);
@@ -548,9 +534,9 @@ static ssize_t taos_als_cal_target_store(struct device *dev,
 	return len;
 }
 
-static ssize_t taos_do_calibrate(struct device *dev,
-				 struct device_attribute *attr,
-				 const char *buf, size_t len)
+static ssize_t in_illuminance_calibrate_store(struct device *dev,
+					      struct device_attribute *attr,
+					      const char *buf, size_t len)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	int value;
@@ -564,8 +550,9 @@ static ssize_t taos_do_calibrate(struct device *dev,
 	return len;
 }
 
-static ssize_t taos_luxtable_show(struct device *dev,
-				  struct device_attribute *attr, char *buf)
+static ssize_t in_illuminance_lux_table_show(struct device *dev,
+					     struct device_attribute *attr,
+					     char *buf)
 {
 	int i;
 	int offset = 0;
@@ -589,9 +576,9 @@ static ssize_t taos_luxtable_show(struct device *dev,
 	return offset;
 }
 
-static ssize_t taos_luxtable_store(struct device *dev,
-				   struct device_attribute *attr,
-				   const char *buf, size_t len)
+static ssize_t in_illuminance_lux_table_store(struct device *dev,
+					      struct device_attribute *attr,
+					      const char *buf, size_t len)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct tsl2583_chip *chip = iio_priv(indio_dev);
@@ -635,25 +622,19 @@ static ssize_t taos_luxtable_store(struct device *dev,
 	return ret;
 }
 
-static DEVICE_ATTR(illuminance0_calibscale_available, S_IRUGO,
-		taos_gain_available_show, NULL);
-
-static DEVICE_ATTR(illuminance0_integration_time_available, S_IRUGO,
-		taos_als_time_available_show, NULL);
-
-static DEVICE_ATTR(illuminance0_input_target, S_IRUGO | S_IWUSR,
-		taos_als_cal_target_show, taos_als_cal_target_store);
-
-static DEVICE_ATTR(illuminance0_calibrate, S_IWUSR, NULL, taos_do_calibrate);
-static DEVICE_ATTR(illuminance0_lux_table, S_IRUGO | S_IWUSR,
-		taos_luxtable_show, taos_luxtable_store);
+static IIO_CONST_ATTR(in_illuminance_calibscale_available, "1 8 16 111");
+static IIO_CONST_ATTR(in_illuminance_integration_time_available,
+		      "0.000050 0.000100 0.000150 0.000200 0.000250 0.000300 0.000350 0.000400 0.000450 0.000500 0.000550 0.000600 0.000650");
+static IIO_DEVICE_ATTR_RW(in_illuminance_input_target, 0);
+static IIO_DEVICE_ATTR_WO(in_illuminance_calibrate, 0);
+static IIO_DEVICE_ATTR_RW(in_illuminance_lux_table, 0);
 
 static struct attribute *sysfs_attrs_ctrl[] = {
-	&dev_attr_illuminance0_calibscale_available.attr,
-	&dev_attr_illuminance0_integration_time_available.attr,
-	&dev_attr_illuminance0_input_target.attr,
-	&dev_attr_illuminance0_calibrate.attr,
-	&dev_attr_illuminance0_lux_table.attr,
+	&iio_const_attr_in_illuminance_calibscale_available.dev_attr.attr,
+	&iio_const_attr_in_illuminance_integration_time_available.dev_attr.attr,
+	&iio_dev_attr_in_illuminance_input_target.dev_attr.attr,
+	&iio_dev_attr_in_illuminance_calibrate.dev_attr.attr,
+	&iio_dev_attr_in_illuminance_lux_table.dev_attr.attr,
 	NULL
 };
 
-- 
2.7.4

^ permalink raw reply related

* [PATCH 09/10] staging: iio: tsl2583: add error code to sysfs store functions
From: Brian Masney @ 2016-10-28 10:00 UTC (permalink / raw)
  To: jic23, linux-iio
  Cc: devel, devicetree, lars, gregkh, linux-kernel, robh+dt, pmeerw,
	knaack.h, Mark.Rutland
In-Reply-To: <1477648821-3786-1-git-send-email-masneyb@onstation.org>

in_illuminance_input_target_store() and in_illuminance_calibrate_store()
validated the data from userspace, however it would not return an
error code to userspace if an invalid value was passed in. This patch
changes these functions so that they return -EINVAL if invalid data is
passed in.

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 drivers/staging/iio/light/tsl2583.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
index 1462374..98afa5b 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -525,11 +525,10 @@ static ssize_t in_illuminance_input_target_store(struct device *dev,
 	struct tsl2583_chip *chip = iio_priv(indio_dev);
 	int value;
 
-	if (kstrtoint(buf, 0, &value))
+	if (kstrtoint(buf, 0, &value) || !value)
 		return -EINVAL;
 
-	if (value)
-		chip->taos_settings.als_cal_target = value;
+	chip->taos_settings.als_cal_target = value;
 
 	return len;
 }
@@ -541,11 +540,10 @@ static ssize_t in_illuminance_calibrate_store(struct device *dev,
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	int value;
 
-	if (kstrtoint(buf, 0, &value))
+	if (kstrtoint(buf, 0, &value) || value != 1)
 		return -EINVAL;
 
-	if (value == 1)
-		taos_als_calibrate(indio_dev);
+	taos_als_calibrate(indio_dev);
 
 	return len;
 }
-- 
2.7.4

^ permalink raw reply related

* [PATCH 10/10] staging: iio: tsl2583: add locking to sysfs attributes
From: Brian Masney @ 2016-10-28 10:00 UTC (permalink / raw)
  To: jic23, linux-iio
  Cc: devel, devicetree, lars, gregkh, linux-kernel, robh+dt, pmeerw,
	knaack.h, Mark.Rutland
In-Reply-To: <1477648821-3786-1-git-send-email-masneyb@onstation.org>

in_illuminance_input_target_show(), in_illuminance_input_target_store(),
in_illuminance_calibrate_store(), and in_illuminance_lux_table_store()
accesses data from the tsl2583_chip struct. Some of these fields can be
modified by other parts of the driver concurrently. This patch adds the
mutex locking to these sysfs attributes.

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 drivers/staging/iio/light/tsl2583.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
index 98afa5b..49b19f5 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -513,8 +513,13 @@ static ssize_t in_illuminance_input_target_show(struct device *dev,
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct tsl2583_chip *chip = iio_priv(indio_dev);
+	int ret;
+
+	mutex_lock(&chip->als_mutex);
+	ret = sprintf(buf, "%d\n", chip->taos_settings.als_cal_target);
+	mutex_unlock(&chip->als_mutex);
 
-	return sprintf(buf, "%d\n", chip->taos_settings.als_cal_target);
+	return ret;
 }
 
 static ssize_t in_illuminance_input_target_store(struct device *dev,
@@ -528,7 +533,9 @@ static ssize_t in_illuminance_input_target_store(struct device *dev,
 	if (kstrtoint(buf, 0, &value) || !value)
 		return -EINVAL;
 
+	mutex_lock(&chip->als_mutex);
 	chip->taos_settings.als_cal_target = value;
+	mutex_unlock(&chip->als_mutex);
 
 	return len;
 }
@@ -538,12 +545,15 @@ static ssize_t in_illuminance_calibrate_store(struct device *dev,
 					      const char *buf, size_t len)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
+	struct tsl2583_chip *chip = iio_priv(indio_dev);
 	int value;
 
 	if (kstrtoint(buf, 0, &value) || value != 1)
 		return -EINVAL;
 
+	mutex_lock(&chip->als_mutex);
 	taos_als_calibrate(indio_dev);
+	mutex_unlock(&chip->als_mutex);
 
 	return len;
 }
@@ -583,6 +593,8 @@ static ssize_t in_illuminance_lux_table_store(struct device *dev,
 	int value[ARRAY_SIZE(taos_device_lux) * 3 + 1];
 	int n, ret = -EINVAL;
 
+	mutex_lock(&chip->als_mutex);
+
 	get_options(buf, ARRAY_SIZE(value), value);
 
 	/* We now have an array of ints starting at value[1], and
@@ -617,6 +629,8 @@ static ssize_t in_illuminance_lux_table_store(struct device *dev,
 	ret = len;
 
 done:
+	mutex_unlock(&chip->als_mutex);
+
 	return ret;
 }
 
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH] ARM: DTS: da850: Add DMA to SPI0
From: Sekhar Nori @ 2016-10-28 10:05 UTC (permalink / raw)
  To: David Lechner, Rob Herring, Mark Rutland, Kevin Hilman
  Cc: Russell King, devicetree, linux-arm-kernel, linux-kernel
In-Reply-To: <1477438368-16208-1-git-send-email-david@lechnology.com>

On Wednesday 26 October 2016 05:02 AM, David Lechner wrote:
> Add the bindings for DMA on SPI0
> 
> Signed-off-by: David Lechner <david@lechnology.com>

Applied to v4.10/dt. small-case'd "DTS" in subject line while applying.

Thanks,
Sekhar

^ permalink raw reply

* Re: [PATCH 3/6] Documentation: devicetree: dwc3: Add interrupt moderation
From: Felipe Balbi @ 2016-10-28 10:09 UTC (permalink / raw)
  To: John Youn
In-Reply-To: <911fcadd-b852-d9db-c733-2df7c106c8d1-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1348 bytes --]


Hi,

John Youn <John.Youn-HKixBCOQz3hWk0Htik3J/w@public.gmane.org> writes:
> On 10/27/2016 3:47 AM, Felipe Balbi wrote:
>> 
>> Hi,
>> 
>> John Youn <johnyoun-HKixBCOQz3hWk0Htik3J/w@public.gmane.org> writes:
>>> Add interrupt moderation interval binding for dwc3.
>>>
>>> Signed-off-by: John Youn <johnyoun-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
>>> ---
>>>  Documentation/devicetree/bindings/usb/dwc3.txt | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt
>>> index e3e6983..17de9fc 100644
>>> --- a/Documentation/devicetree/bindings/usb/dwc3.txt
>>> +++ b/Documentation/devicetree/bindings/usb/dwc3.txt
>>> @@ -53,6 +53,7 @@ Optional properties:
>>>   - snps,quirk-frame-length-adjustment: Value for GFLADJ_30MHZ field of GFLADJ
>>>  	register for post-silicon frame length adjustment when the
>>>  	fladj_30mhz_sdbnd signal is invalid or incorrect.
>>> + - snps,imod_interval: the interrupt moderation interval.
>> 
>> on top of all other comments, what's the unit here? nanoseconds? clock cycles?
>> 
>
> Number of 250 ns intervals. I'll update the description to clarify.

it's probably better to add it in nanoseconds itself, then let driver
compute register value with DIV_ROUND_UP()

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]

^ permalink raw reply

* [PATCH 0/3] ARM: dts: sun9i: Enable SDIO-based WiFi
From: Chen-Yu Tsai @ 2016-10-28 10:11 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: Chen-Yu Tsai, devicetree, linux-arm-kernel, linux-kernel

Hi Maxime,

Now that we have support for both PMICs, we can turn on the
regulators needed for the onboard WiFi chips.

This is a fairly simple series. The WiFi chips themselves are
supported by the brcmfmac driver, but the user needs to get an
nvram.txt file and put it in their firmware directory, in
addition to the firmware file in linux-firmware. Otherwise we
just need to enable the mmc controller and supply the vmmc and
vqmmc regulators.


Regards
ChenYu

Chen-Yu Tsai (3):
  ARM: dts: sun9i: Add mmc1 pinmux setting
  ARM: dts: sun9i: a80-optimus: Enable AP6330 WiFi
  ARM: dts: sun9i: cubieboard4: Enable AP6330 WiFi

 arch/arm/boot/dts/sun9i-a80-cubieboard4.dts | 32 +++++++++++++++++++++++++++++
 arch/arm/boot/dts/sun9i-a80-optimus.dts     | 30 +++++++++++++++++++++++++++
 arch/arm/boot/dts/sun9i-a80.dtsi            |  8 ++++++++
 3 files changed, 70 insertions(+)

-- 
2.9.3

^ permalink raw reply

* [PATCH 1/3] ARM: dts: sun9i: Add mmc1 pinmux setting
From: Chen-Yu Tsai @ 2016-10-28 10:11 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20161028101154.7350-1-wens-jdAy2FN1RRM@public.gmane.org>

On the A80, mmc1 is available on pingroup G. Designs mostly use this
to connect to an SDIO WiFi chip.

Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
---
 arch/arm/boot/dts/sun9i-a80.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/sun9i-a80.dtsi b/arch/arm/boot/dts/sun9i-a80.dtsi
index 3c5214cbe4e6..ab6a221027ef 100644
--- a/arch/arm/boot/dts/sun9i-a80.dtsi
+++ b/arch/arm/boot/dts/sun9i-a80.dtsi
@@ -700,6 +700,14 @@
 				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
+			mmc1_pins: mmc1 {
+				allwinner,pins = "PG0", "PG1" ,"PG2", "PG3",
+						 "PG4", "PG5";
+				allwinner,function = "mmc1";
+				allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+			};
+
 			mmc2_8bit_pins: mmc2_8bit {
 				allwinner,pins = "PC6", "PC7", "PC8", "PC9",
 						 "PC10", "PC11", "PC12",
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH 2/3] ARM: dts: sun9i: a80-optimus: Enable AP6330 WiFi
From: Chen-Yu Tsai @ 2016-10-28 10:11 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20161028101154.7350-1-wens-jdAy2FN1RRM@public.gmane.org>

The board has a Ampak AP6330 WiFi/BT/FM module. Inside it is a Broadcom
BCM4330 WiFi/BT/FM combo IC. The WiFi portion is connected to mmc1, with
the enabling pin connected to PL2. The AC100 RTC provides a low power
clock signal.

Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
---
 arch/arm/boot/dts/sun9i-a80-optimus.dts | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/arch/arm/boot/dts/sun9i-a80-optimus.dts b/arch/arm/boot/dts/sun9i-a80-optimus.dts
index ceb6ef15d669..7e036b2be762 100644
--- a/arch/arm/boot/dts/sun9i-a80-optimus.dts
+++ b/arch/arm/boot/dts/sun9i-a80-optimus.dts
@@ -105,6 +105,14 @@
 		enable-active-high;
 		gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
 	};
+
+	wifi_pwrseq: wifi_pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		clocks = <&ac100_rtc 1>;
+		clock-names = "ext_clock";
+		/* enables internal regulator and de-asserts reset */
+		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */
+	};
 };
 
 &ehci0 {
@@ -130,6 +138,21 @@
 	status = "okay";
 };
 
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins>, <&wifi_en_pin_optimus>;
+	vmmc-supply = <&reg_dldo1>;
+	vqmmc-supply = <&reg_cldo3>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+};
+
+&mmc1_pins {
+	allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+};
+
 &mmc2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc2_8bit_pins>;
@@ -199,6 +222,13 @@
 		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
 		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 	};
+
+	wifi_en_pin_optimus: wifi_en_pin@0 {
+		allwinner,pins = "PL2";
+		allwinner,function = "gpio_out";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
 };
 
 &r_rsb {
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox