linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the final tree (mfd tree related)
@ 2011-03-21  2:59 Stephen Rothwell
  2011-03-21  8:08 ` [PATCH v7] MAX8997/8966 MFD: Add IRQ control feature MyungJoo Ham
  0 siblings, 1 reply; 24+ messages in thread
From: Stephen Rothwell @ 2011-03-21  2:59 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-next, linux-kernel, MyungJoo Ham, Kyungmin Park

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

Hi Sam,

After merging the final tree, today's linux-next build (powerpc
allyesconfig) failed like this:

drivers/mfd/max8997-irq.c:170: error: unknown field 'bus_lock' specified in initializer
drivers/mfd/max8997-irq.c:170: warning: initialization from incompatible pointer type
drivers/mfd/max8997-irq.c:171: error: unknown field 'bus_sync_unlock' specified in initializer
drivers/mfd/max8997-irq.c:171: warning: initialization from incompatible pointer type
drivers/mfd/max8997-irq.c:172: error: unknown field 'mask' specified in initializer
drivers/mfd/max8997-irq.c:172: warning: initialization from incompatible pointer type
drivers/mfd/max8997-irq.c:173: error: unknown field 'unmask' specified in initializer
drivers/mfd/max8997-irq.c:173: warning: initialization from incompatible pointer type

Caused by commit d7d21d394c9d ("mfd: Add MAX8997/8966 IRQ control feature").

The presence of these fields depends on
CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED not being set.

I have reverted that commit for today.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v7] MAX8997/8966 MFD: Add IRQ control feature
  2011-03-21  2:59 linux-next: build failure after merge of the final tree (mfd tree related) Stephen Rothwell
@ 2011-03-21  8:08 ` MyungJoo Ham
  2011-03-22 11:51   ` Samuel Ortiz
  0 siblings, 1 reply; 24+ messages in thread
From: MyungJoo Ham @ 2011-03-21  8:08 UTC (permalink / raw)
  To: linux-kernel
  Cc: Samuel Ortiz, linux-next, Stephen Rothwell, Kyungmin Park, myungjoo.ham

This patch enables IRQ handling for MAX8997/8966 chips.

Please note that Fuel-Gauge-related IRQs are not implemented in this
initial release. The fuel gauge module in MAX8997 is identical to
MAX17042, which is already in Linux kernel. In order to use the
already-existing MAX17042 driver for fuel gauge module in MAX8997, the
main interrupt handler of MAX8997 should relay related interrupts to
MAX17042 driver. However, in order to do this, we need to modify
MAX17042 driver as well because MAX17042 driver does not have any
interrupt handlers for now. We are not going to implement this in this
initial release as it is not crucial in basic operations of MAX8997.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
--
The changes from previous patch
v7
removed RTC patch from the series as applied
with comments from Stephen
	- Removed dependencies on not setting
	"CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED"
v6
with comments from Samuel
	- IRQ register bit values use macros
corrected GPIO interrupt handling
RTC configuration bit values use macros
v5
with comments from Mark
	- Style updated for PMIC
	- Revised side-effect calculation
	In the range given, choose a setting without side-effect
	then, choose a setting with the least side-effect if allowed.
Added comments on FUEL-GAUGE issue in IRQ

v4
with comments from Randy:
	- Spelling errors in Kconfig
with comments from Minsung Kim:
	- RTC month bit error.

v3
with comments from Joe:
	- Style updated for IRQ and RTC
with comments from Mark
	- Style updated for RTC and PMIC
Merged support for RTC and IRQ

v2
with comments from Samuel:
	- Style updated for MFD
with comments from Mark:
	- Updated API for next and 2.6.38
	- Style updated for regulators
Support for hibernation
Support for bulk register access
Corrected register names
Added RTC/IRQ registers
LDO access bug fixed
Support for regulator suspend state control
---
 drivers/mfd/Makefile                |    2 +-
 drivers/mfd/max8997-irq.c           |  425 +++++++++++++++++++++++++++++++++++
 include/linux/mfd/max8997-private.h |   21 ++
 include/linux/mfd/max8997.h         |    7 +-
 4 files changed, 452 insertions(+), 3 deletions(-)
 create mode 100644 drivers/mfd/max8997-irq.c

diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index f6662e3..4cff10c 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -60,7 +60,7 @@ obj-$(CONFIG_UCB1400_CORE)	+= ucb1400_core.o
 obj-$(CONFIG_PMIC_DA903X)	+= da903x.o
 max8925-objs			:= max8925-core.o max8925-i2c.o
 obj-$(CONFIG_MFD_MAX8925)	+= max8925.o
-obj-$(CONFIG_MFD_MAX8997)	+= max8997.o
+obj-$(CONFIG_MFD_MAX8997)	+= max8997.o max8997-irq.o
 obj-$(CONFIG_MFD_MAX8998)	+= max8998.o max8998-irq.o
 
 pcf50633-objs			:= pcf50633-core.o pcf50633-irq.o
diff --git a/drivers/mfd/max8997-irq.c b/drivers/mfd/max8997-irq.c
new file mode 100644
index 0000000..b9894ba
--- /dev/null
+++ b/drivers/mfd/max8997-irq.c
@@ -0,0 +1,425 @@
+/*
+ * max8997-irq.c - Interrupt controller support for MAX8997
+ *
+ * Copyright (C) 2011 Samsung Electronics Co.Ltd
+ * MyungJoo Ham <myungjoo.ham@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * This driver is based on max8998-irq.c
+ */
+
+#include <linux/err.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/mfd/max8997.h>
+#include <linux/mfd/max8997-private.h>
+
+static const u8 max8997_mask_reg[] = {
+	[PMIC_INT1] = MAX8997_REG_INT1MSK,
+	[PMIC_INT2] = MAX8997_REG_INT2MSK,
+	[PMIC_INT3] = MAX8997_REG_INT3MSK,
+	[PMIC_INT4] = MAX8997_REG_INT4MSK,
+	[FUEL_GAUGE] = MAX8997_REG_INVALID,
+	[MUIC_INT1] = MAX8997_MUIC_REG_INTMASK1,
+	[MUIC_INT2] = MAX8997_MUIC_REG_INTMASK2,
+	[MUIC_INT3] = MAX8997_MUIC_REG_INTMASK3,
+	[GPIO_LOW] = MAX8997_REG_INVALID,
+	[GPIO_HI] = MAX8997_REG_INVALID,
+	[FLASH_STATUS] = MAX8997_REG_INVALID,
+};
+
+static struct i2c_client *get_i2c(struct max8997_dev *max8997,
+				enum max8997_irq_source src)
+{
+	switch (src) {
+	case PMIC_INT1 ... PMIC_INT4:
+		return max8997->i2c;
+	case FUEL_GAUGE:
+		return NULL;
+	case MUIC_INT1 ... MUIC_INT3:
+		return max8997->muic;
+	case GPIO_LOW ... GPIO_HI:
+		return max8997->i2c;
+	case FLASH_STATUS:
+		return max8997->i2c;
+	default:
+		return ERR_PTR(-EINVAL);
+	}
+
+	return ERR_PTR(-EINVAL);
+}
+
+struct max8997_irq_data {
+	int mask;
+	enum max8997_irq_source group;
+};
+
+#define DECLARE_IRQ(idx, _group, _mask)		\
+	[(idx)] = { .group = (_group), .mask = (_mask) }
+static const struct max8997_irq_data max8997_irqs[] = {
+	DECLARE_IRQ(MAX8997_PMICIRQ_PWRONR,	PMIC_INT1, 1 << 0),
+	DECLARE_IRQ(MAX8997_PMICIRQ_PWRONF,	PMIC_INT1, 1 << 1),
+	DECLARE_IRQ(MAX8997_PMICIRQ_PWRON1SEC,	PMIC_INT1, 1 << 3),
+	DECLARE_IRQ(MAX8997_PMICIRQ_JIGONR,	PMIC_INT1, 1 << 4),
+	DECLARE_IRQ(MAX8997_PMICIRQ_JIGONF,	PMIC_INT1, 1 << 5),
+	DECLARE_IRQ(MAX8997_PMICIRQ_LOWBAT2,	PMIC_INT1, 1 << 6),
+	DECLARE_IRQ(MAX8997_PMICIRQ_LOWBAT1,	PMIC_INT1, 1 << 7),
+
+	DECLARE_IRQ(MAX8997_PMICIRQ_JIGR,	PMIC_INT2, 1 << 0),
+	DECLARE_IRQ(MAX8997_PMICIRQ_JIGF,	PMIC_INT2, 1 << 1),
+	DECLARE_IRQ(MAX8997_PMICIRQ_MR,		PMIC_INT2, 1 << 2),
+	DECLARE_IRQ(MAX8997_PMICIRQ_DVS1OK,	PMIC_INT2, 1 << 3),
+	DECLARE_IRQ(MAX8997_PMICIRQ_DVS2OK,	PMIC_INT2, 1 << 4),
+	DECLARE_IRQ(MAX8997_PMICIRQ_DVS3OK,	PMIC_INT2, 1 << 5),
+	DECLARE_IRQ(MAX8997_PMICIRQ_DVS4OK,	PMIC_INT2, 1 << 6),
+
+	DECLARE_IRQ(MAX8997_PMICIRQ_CHGINS,	PMIC_INT3, 1 << 0),
+	DECLARE_IRQ(MAX8997_PMICIRQ_CHGRM,	PMIC_INT3, 1 << 1),
+	DECLARE_IRQ(MAX8997_PMICIRQ_DCINOVP,	PMIC_INT3, 1 << 2),
+	DECLARE_IRQ(MAX8997_PMICIRQ_TOPOFFR,	PMIC_INT3, 1 << 3),
+	DECLARE_IRQ(MAX8997_PMICIRQ_CHGRSTF,	PMIC_INT3, 1 << 5),
+	DECLARE_IRQ(MAX8997_PMICIRQ_MBCHGTMEXPD,	PMIC_INT3, 1 << 7),
+
+	DECLARE_IRQ(MAX8997_PMICIRQ_RTC60S,	PMIC_INT4, 1 << 0),
+	DECLARE_IRQ(MAX8997_PMICIRQ_RTCA1,	PMIC_INT4, 1 << 1),
+	DECLARE_IRQ(MAX8997_PMICIRQ_RTCA2,	PMIC_INT4, 1 << 2),
+	DECLARE_IRQ(MAX8997_PMICIRQ_SMPL_INT,	PMIC_INT4, 1 << 3),
+	DECLARE_IRQ(MAX8997_PMICIRQ_RTC1S,	PMIC_INT4, 1 << 4),
+	DECLARE_IRQ(MAX8997_PMICIRQ_WTSR,	PMIC_INT4, 1 << 5),
+
+	DECLARE_IRQ(MAX8997_MUICIRQ_ADCError,	MUIC_INT1, 1 << 2),
+	DECLARE_IRQ(MAX8997_MUICIRQ_ADCLow,	MUIC_INT1, 1 << 1),
+	DECLARE_IRQ(MAX8997_MUICIRQ_ADC,	MUIC_INT1, 1 << 0),
+
+	DECLARE_IRQ(MAX8997_MUICIRQ_VBVolt,	MUIC_INT2, 1 << 4),
+	DECLARE_IRQ(MAX8997_MUICIRQ_DBChg,	MUIC_INT2, 1 << 3),
+	DECLARE_IRQ(MAX8997_MUICIRQ_DCDTmr,	MUIC_INT2, 1 << 2),
+	DECLARE_IRQ(MAX8997_MUICIRQ_ChgDetRun,	MUIC_INT2, 1 << 1),
+	DECLARE_IRQ(MAX8997_MUICIRQ_ChgTyp,	MUIC_INT2, 1 << 0),
+
+	DECLARE_IRQ(MAX8997_MUICIRQ_OVP,	MUIC_INT3, 1 << 2),
+};
+
+#ifdef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED
+static void max8997_irq_lock(struct irq_data *data)
+{
+	struct max8997_dev *max8997 = get_irq_chip_data(data->irq);
+
+	mutex_lock(&max8997->irqlock);
+}
+
+static void max8997_irq_sync_unlock(struct irq_data *data)
+{
+	struct max8997_dev *max8997 = get_irq_chip_data(data->irq);
+	int i;
+
+	for (i = 0; i < MAX8997_IRQ_GROUP_NR; i++) {
+		u8 mask_reg = max8997_mask_reg[i];
+		struct i2c_client *i2c = get_i2c(max8997, i);
+
+		if (mask_reg == MAX8997_REG_INVALID ||
+				IS_ERR_OR_NULL(i2c))
+			continue;
+		max8997->irq_masks_cache[i] = max8997->irq_masks_cur[i];
+
+		max8997_write_reg(i2c, max8997_mask_reg[i],
+				max8997->irq_masks_cur[i]);
+	}
+
+	mutex_unlock(&max8997->irqlock);
+}
+
+static void max8997_irq_mask(struct irq_data *data)
+{
+	max8997->irq_masks_cur[irq_data->group] |= irq_data->mask;
+}
+
+static void max8997_irq_unmask(struct irq_data *data)
+{
+	max8997->irq_masks_cur[irq_data->group] &= ~irq_data->mask;
+}
+
+#else /* CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED */
+static const inline struct max8997_irq_data *
+irq_to_max8997_irq(struct max8997_dev *max8997, int irq)
+{
+	return &max8997_irqs[irq - max8997->irq_base];
+}
+
+static void max8997_irq_lock(unsigned int irq)
+{
+	struct max8997_dev *max8997 = get_irq_chip_data(irq);
+
+	mutex_lock(&max8997->irqlock);
+}
+
+static void max8997_irq_sync_unlock(unsigned int irq)
+{
+	struct max8997_dev *max8997 = get_irq_chip_data(irq);
+	int i;
+
+	for (i = 0; i < MAX8997_IRQ_GROUP_NR; i++) {
+		u8 mask_reg = max8997_mask_reg[i];
+		struct i2c_client *i2c = get_i2c(max8997, i);
+
+		if (mask_reg == MAX8997_REG_INVALID ||
+				IS_ERR_OR_NULL(i2c))
+			continue;
+		max8997->irq_masks_cache[i] = max8997->irq_masks_cur[i];
+
+		max8997_write_reg(i2c, max8997_mask_reg[i],
+				max8997->irq_masks_cur[i]);
+	}
+
+	mutex_unlock(&max8997->irqlock);
+}
+
+static void max8997_irq_mask(unsigned int irq)
+{
+	struct max8997_dev *max8997 = get_irq_chip_data(irq);
+	const struct max8997_irq_data *irq_data = irq_to_max8997_irq(max8997,
+									irq);
+
+	max8997->irq_masks_cur[irq_data->group] |= irq_data->mask;
+}
+
+static void max8997_irq_unmask(unsigned int irq)
+{
+	struct max8997_dev *max8997 = get_irq_chip_data(irq);
+	const struct max8997_irq_data *irq_data = irq_to_max8997_irq(max8997,
+									irq);
+
+	max8997->irq_masks_cur[irq_data->group] &= ~irq_data->mask;
+}
+#endif /* CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED */
+
+static struct irq_chip max8997_irq_chip = {
+	.name			= "max8997",
+#ifdef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED
+	.irq_bus_lock		= max8997_irq_lock,
+	.irq_bus_sync_unlock	= max8997_irq_sync_unlock,
+	.irq_mask		= max8997_irq_mask,
+	.irq_unmask		= max8997_irq_unmask,
+#else /* CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED */
+	.bus_lock		= max8997_irq_lock,
+	.bus_sync_unlock	= max8997_irq_sync_unlock,
+	.mask			= max8997_irq_mask,
+	.unmask			= max8997_irq_unmask,
+#endif /* CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED */
+};
+
+#define MAX8997_IRQSRC_PMIC		(1 << 1)
+#define MAX8997_IRQSRC_FUELGAUGE	(1 << 2)
+#define MAX8997_IRQSRC_MUIC		(1 << 3)
+#define MAX8997_IRQSRC_GPIO		(1 << 4)
+#define MAX8997_IRQSRC_FLASH		(1 << 5)
+static irqreturn_t max8997_irq_thread(int irq, void *data)
+{
+	struct max8997_dev *max8997 = data;
+	u8 irq_reg[MAX8997_IRQ_GROUP_NR] = {};
+	u8 irq_src;
+	int ret;
+	int i;
+
+	ret = max8997_read_reg(max8997->i2c, MAX8997_REG_INTSRC, &irq_src);
+	if (ret < 0) {
+		dev_err(max8997->dev, "Failed to read interrupt source: %d\n",
+				ret);
+		return IRQ_NONE;
+	}
+
+	if (irq_src & MAX8997_IRQSRC_PMIC) {
+		/* PMIC INT1 ~ INT4 */
+		max8997_bulk_read(max8997->i2c, MAX8997_REG_INT1, 4,
+				&irq_reg[PMIC_INT1]);
+	}
+	if (irq_src & MAX8997_IRQSRC_FUELGAUGE) {
+		/*
+		 * TODO: FUEL GAUGE
+		 *
+		 * This is to be supported by Max17042 driver. When
+		 * an interrupt incurs here, it should be relayed to a
+		 * Max17042 device that is connected (probably by
+		 * platform-data). However, we do not have interrupt
+		 * handling in Max17042 driver currently. The Max17042 IRQ
+		 * driver should be ready to be used as a stand-alone device and
+		 * a Max8997-dependent device. Because it is not ready in
+		 * Max17042-side and it is not too critical in operating
+		 * Max8997, we do not implement this in initial releases.
+		 */
+		irq_reg[FUEL_GAUGE] = 0;
+	}
+	if (irq_src & MAX8997_IRQSRC_MUIC) {
+		/* MUIC INT1 ~ INT3 */
+		max8997_bulk_read(max8997->muic, MAX8997_MUIC_REG_INT1, 3,
+				&irq_reg[MUIC_INT1]);
+	}
+	if (irq_src & MAX8997_IRQSRC_GPIO) {
+		/* GPIO Interrupt */
+		u8 gpio_info[MAX8997_NUM_GPIO];
+
+		irq_reg[GPIO_LOW] = 0;
+		irq_reg[GPIO_HI] = 0;
+
+		max8997_bulk_read(max8997->i2c, MAX8997_REG_GPIOCNTL1,
+				MAX8997_NUM_GPIO, gpio_info);
+		for (i = 0; i < MAX8997_NUM_GPIO; i++) {
+			bool interrupt = false;
+
+			switch (gpio_info[i] & MAX8997_GPIO_INT_MASK) {
+			case MAX8997_GPIO_INT_BOTH:
+				if (max8997->gpio_status[i] != gpio_info[i])
+					interrupt = true;
+				break;
+			case MAX8997_GPIO_INT_RISE:
+				if ((max8997->gpio_status[i] != gpio_info[i]) &&
+				    (gpio_info[i] & MAX8997_GPIO_DATA_MASK))
+					interrupt = true;
+				break;
+			case MAX8997_GPIO_INT_FALL:
+				if ((max8997->gpio_status[i] != gpio_info[i]) &&
+				    !(gpio_info[i] & MAX8997_GPIO_DATA_MASK))
+					interrupt = true;
+				break;
+			default:
+				break;
+			}
+
+			if (interrupt) {
+				if (i < 8)
+					irq_reg[GPIO_LOW] |= (1 << i);
+				else
+					irq_reg[GPIO_HI] |= (1 << (i - 8));
+			}
+
+		}
+	}
+	if (irq_src & MAX8997_IRQSRC_FLASH) {
+		/* Flash Status Interrupt */
+		ret = max8997_read_reg(max8997->i2c, MAX8997_REG_FLASHSTATUS,
+				&irq_reg[FLASH_STATUS]);
+	}
+
+	/* Apply masking */
+	for (i = 0; i < MAX8997_IRQ_GROUP_NR; i++)
+		irq_reg[i] &= ~max8997->irq_masks_cur[i];
+
+	/* Report */
+	for (i = 0; i < MAX8997_IRQ_NR; i++) {
+		if (irq_reg[max8997_irqs[i].group] & max8997_irqs[i].mask)
+			handle_nested_irq(max8997->irq_base + i);
+	}
+
+	return IRQ_HANDLED;
+}
+
+int max8997_irq_resume(struct max8997_dev *max8997)
+{
+	if (max8997->irq && max8997->irq_base)
+		max8997_irq_thread(max8997->irq_base, max8997);
+	return 0;
+}
+
+int max8997_irq_init(struct max8997_dev *max8997)
+{
+	int i;
+	int cur_irq;
+	int ret;
+	u8 val;
+
+	if (!max8997->irq) {
+		dev_warn(max8997->dev, "No interrupt specified.\n");
+		max8997->irq_base = 0;
+		return 0;
+	}
+
+	if (!max8997->irq_base) {
+		dev_err(max8997->dev, "No interrupt base specified.\n");
+		return 0;
+	}
+
+	mutex_init(&max8997->irqlock);
+
+	/* Mask individual interrupt sources */
+	for (i = 0; i < MAX8997_IRQ_GROUP_NR; i++) {
+		struct i2c_client *i2c;
+
+		max8997->irq_masks_cur[i] = 0xff;
+		max8997->irq_masks_cache[i] = 0xff;
+		i2c = get_i2c(max8997, i);
+
+		if (IS_ERR_OR_NULL(i2c))
+			continue;
+		if (max8997_mask_reg[i] == MAX8997_REG_INVALID)
+			continue;
+
+		max8997_write_reg(i2c, max8997_mask_reg[i], 0xff);
+	}
+
+	for (i = 0; i < MAX8997_NUM_GPIO; i++) {
+		max8997->gpio_status[i] = (max8997_read_reg(max8997->i2c,
+						MAX8997_REG_GPIOCNTL1 + i,
+						&val)
+					& MAX8997_GPIO_DATA_MASK) ?
+					true : false;
+	}
+
+	/* Register with genirq */
+	for (i = 0; i < MAX8997_IRQ_NR; i++) {
+		cur_irq = i + max8997->irq_base;
+		set_irq_chip_data(cur_irq, max8997);
+		set_irq_chip_and_handler(cur_irq, &max8997_irq_chip,
+				handle_edge_irq);
+		set_irq_nested_thread(cur_irq, 1);
+#ifdef CONFIG_ARM
+		set_irq_flags(cur_irq, IRQF_VALID);
+#else
+		set_irq_noprobe(cur_irq);
+#endif
+	}
+
+	ret = request_threaded_irq(max8997->irq, NULL, max8997_irq_thread,
+			IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+			"max8997-irq", max8997);
+
+	if (ret) {
+		dev_err(max8997->dev, "Failed to request IRQ %d: %d\n",
+				max8997->irq, ret);
+		return ret;
+	}
+
+	if (!max8997->ono)
+		return 0;
+
+	ret = request_threaded_irq(max8997->ono, NULL, max8997_irq_thread,
+			IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING |
+			IRQF_ONESHOT, "max8997-ono", max8997);
+
+	if (ret)
+		dev_err(max8997->dev, "Failed to request ono-IRQ %d: %d\n",
+				max8997->ono, ret);
+
+	return 0;
+}
+
+void max8997_irq_exit(struct max8997_dev *max8997)
+{
+	if (max8997->ono)
+		free_irq(max8997->ono, max8997);
+
+	if (max8997->irq)
+		free_irq(max8997->irq, max8997);
+}
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h
index 93a9477..69d1010 100644
--- a/include/linux/mfd/max8997-private.h
+++ b/include/linux/mfd/max8997-private.h
@@ -24,6 +24,8 @@
 
 #include <linux/i2c.h>
 
+#define MAX8997_REG_INVALID	(0xff)
+
 enum max8997_pmic_reg {
 	MAX8997_REG_PMIC_ID0	= 0x00,
 	MAX8997_REG_PMIC_ID1	= 0x01,
@@ -313,6 +315,7 @@ enum max8997_irq {
 #define MAX8997_REG_BUCK2DVS(x)	(MAX8997_REG_BUCK2DVS1 + (x) - 1)
 #define MAX8997_REG_BUCK5DVS(x)	(MAX8997_REG_BUCK5DVS1 + (x) - 1)
 
+#define MAX8997_NUM_GPIO	12
 struct max8997_dev {
 	struct device *dev;
 	struct i2c_client *i2c; /* 0xcc / PMIC, Battery Control, and FLASH */
@@ -324,11 +327,19 @@ struct max8997_dev {
 	int type;
 	struct platform_device *battery; /* battery control (not fuel gauge) */
 
+	int irq;
+	int ono;
+	int irq_base;
 	bool wakeup;
+	struct mutex irqlock;
+	int irq_masks_cur[MAX8997_IRQ_GROUP_NR];
+	int irq_masks_cache[MAX8997_IRQ_GROUP_NR];
 
 	/* For hibernation */
 	u8 reg_dump[MAX8997_REG_PMIC_END + MAX8997_MUIC_REG_END +
 		MAX8997_HAPTIC_REG_END];
+
+	bool gpio_status[MAX8997_NUM_GPIO];
 };
 
 enum max8997_types {
@@ -336,6 +347,10 @@ enum max8997_types {
 	TYPE_MAX8966,
 };
 
+extern int max8997_irq_init(struct max8997_dev *max8997);
+extern void max8997_irq_exit(struct max8997_dev *max8997);
+extern int max8997_irq_resume(struct max8997_dev *max8997);
+
 extern int max8997_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest);
 extern int max8997_bulk_read(struct i2c_client *i2c, u8 reg, int count,
 				u8 *buf);
@@ -344,4 +359,10 @@ extern int max8997_bulk_write(struct i2c_client *i2c, u8 reg, int count,
 				u8 *buf);
 extern int max8997_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask);
 
+#define MAX8997_GPIO_INT_BOTH	(0x3 << 4)
+#define MAX8997_GPIO_INT_RISE	(0x2 << 4)
+#define MAX8997_GPIO_INT_FALL	(0x1 << 4)
+
+#define MAX8997_GPIO_INT_MASK	(0x3 << 4)
+#define MAX8997_GPIO_DATA_MASK	(0x1 << 2)
 #endif /*  __LINUX_MFD_MAX8997_PRIV_H */
diff --git a/include/linux/mfd/max8997.h b/include/linux/mfd/max8997.h
index cb671b3..60931d0 100644
--- a/include/linux/mfd/max8997.h
+++ b/include/linux/mfd/max8997.h
@@ -78,8 +78,11 @@ struct max8997_regulator_data {
 };
 
 struct max8997_platform_data {
-	bool wakeup;
-	/* IRQ: Not implemented */
+	/* IRQ */
+	int irq_base;
+	int ono;
+	int wakeup;
+
 	/* ---- PMIC ---- */
 	struct max8997_regulator_data *regulators;
 	int num_regulators;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH v7] MAX8997/8966 MFD: Add IRQ control feature
  2011-03-21  8:08 ` [PATCH v7] MAX8997/8966 MFD: Add IRQ control feature MyungJoo Ham
@ 2011-03-22 11:51   ` Samuel Ortiz
  2011-03-24  6:54     ` [PATCH] " MyungJoo Ham
  0 siblings, 1 reply; 24+ messages in thread
From: Samuel Ortiz @ 2011-03-22 11:51 UTC (permalink / raw)
  To: MyungJoo Ham
  Cc: linux-kernel, linux-next, Stephen Rothwell, Kyungmin Park, myungjoo.ham

Hi MyungJoo,

On Mon, Mar 21, 2011 at 05:08:24PM +0900, MyungJoo Ham wrote:
> +static struct irq_chip max8997_irq_chip = {
> +	.name			= "max8997",
> +#ifdef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED
> +	.irq_bus_lock		= max8997_irq_lock,
> +	.irq_bus_sync_unlock	= max8997_irq_sync_unlock,
> +	.irq_mask		= max8997_irq_mask,
> +	.irq_unmask		= max8997_irq_unmask,
> +#else /* CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED */
> +	.bus_lock		= max8997_irq_lock,
> +	.bus_sync_unlock	= max8997_irq_sync_unlock,
> +	.mask			= max8997_irq_mask,
> +	.unmask			= max8997_irq_unmask,
> +#endif /* CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED */
> +};
You actually don't need to define both pointer sets. Setting the irq_* ones
should be enough for both configs.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] MAX8997/8966 MFD: Add IRQ control feature
  2011-03-22 11:51   ` Samuel Ortiz
@ 2011-03-24  6:54     ` MyungJoo Ham
  0 siblings, 0 replies; 24+ messages in thread
From: MyungJoo Ham @ 2011-03-24  6:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: Samuel Ortiz, linux-next, Stephen Rothwell, Kyungmin Park, myungjoo.ham

This patch enables IRQ handling for MAX8997/8966 chips.

Please note that Fuel-Gauge-related IRQs are not implemented in this
initial release. The fuel gauge module in MAX8997 is identical to
MAX17042, which is already in Linux kernel. In order to use the
already-existing MAX17042 driver for fuel gauge module in MAX8997, the
main interrupt handler of MAX8997 should relay related interrupts to
MAX17042 driver. However, in order to do this, we need to modify
MAX17042 driver as well because MAX17042 driver does not have any
interrupt handlers for now. We are not going to implement this in this
initial release as it is not crucial in basic operations of MAX8997.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
--
The changes from previous patch
v8
removed unnecessary code and fixed errors.
v7
removed RTC patch from the series as applied
with comments from Stephen
	- Removed dependencies on not setting
	"CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED"
v6
with comments from Samuel
	- IRQ register bit values use macros
corrected GPIO interrupt handling
RTC configuration bit values use macros
v5
with comments from Mark
	- Style updated for PMIC
	- Revised side-effect calculation
	In the range given, choose a setting without side-effect
	then, choose a setting with the least side-effect if allowed.
Added comments on FUEL-GAUGE issue in IRQ

v4
with comments from Randy:
	- Spelling errors in Kconfig
with comments from Minsung Kim:
	- RTC month bit error.

v3
with comments from Joe:
	- Style updated for IRQ and RTC
with comments from Mark
	- Style updated for RTC and PMIC
Merged support for RTC and IRQ

v2
with comments from Samuel:
	- Style updated for MFD
with comments from Mark:
	- Updated API for next and 2.6.38
	- Style updated for regulators
Support for hibernation
Support for bulk register access
Corrected register names
Added RTC/IRQ registers
LDO access bug fixed
Support for regulator suspend state control
---
 drivers/mfd/Makefile                |    2 +-
 drivers/mfd/max8997-irq.c           |  377 +++++++++++++++++++++++++++++++++++
 include/linux/mfd/max8997-private.h |   21 ++
 include/linux/mfd/max8997.h         |    7 +-
 4 files changed, 404 insertions(+), 3 deletions(-)
 create mode 100644 drivers/mfd/max8997-irq.c

diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index f6662e3..4cff10c 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -60,7 +60,7 @@ obj-$(CONFIG_UCB1400_CORE)	+= ucb1400_core.o
 obj-$(CONFIG_PMIC_DA903X)	+= da903x.o
 max8925-objs			:= max8925-core.o max8925-i2c.o
 obj-$(CONFIG_MFD_MAX8925)	+= max8925.o
-obj-$(CONFIG_MFD_MAX8997)	+= max8997.o
+obj-$(CONFIG_MFD_MAX8997)	+= max8997.o max8997-irq.o
 obj-$(CONFIG_MFD_MAX8998)	+= max8998.o max8998-irq.o
 
 pcf50633-objs			:= pcf50633-core.o pcf50633-irq.o
diff --git a/drivers/mfd/max8997-irq.c b/drivers/mfd/max8997-irq.c
new file mode 100644
index 0000000..e85c874
--- /dev/null
+++ b/drivers/mfd/max8997-irq.c
@@ -0,0 +1,377 @@
+/*
+ * max8997-irq.c - Interrupt controller support for MAX8997
+ *
+ * Copyright (C) 2011 Samsung Electronics Co.Ltd
+ * MyungJoo Ham <myungjoo.ham@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * This driver is based on max8998-irq.c
+ */
+
+#include <linux/err.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/mfd/max8997.h>
+#include <linux/mfd/max8997-private.h>
+
+static const u8 max8997_mask_reg[] = {
+	[PMIC_INT1] = MAX8997_REG_INT1MSK,
+	[PMIC_INT2] = MAX8997_REG_INT2MSK,
+	[PMIC_INT3] = MAX8997_REG_INT3MSK,
+	[PMIC_INT4] = MAX8997_REG_INT4MSK,
+	[FUEL_GAUGE] = MAX8997_REG_INVALID,
+	[MUIC_INT1] = MAX8997_MUIC_REG_INTMASK1,
+	[MUIC_INT2] = MAX8997_MUIC_REG_INTMASK2,
+	[MUIC_INT3] = MAX8997_MUIC_REG_INTMASK3,
+	[GPIO_LOW] = MAX8997_REG_INVALID,
+	[GPIO_HI] = MAX8997_REG_INVALID,
+	[FLASH_STATUS] = MAX8997_REG_INVALID,
+};
+
+static struct i2c_client *get_i2c(struct max8997_dev *max8997,
+				enum max8997_irq_source src)
+{
+	switch (src) {
+	case PMIC_INT1 ... PMIC_INT4:
+		return max8997->i2c;
+	case FUEL_GAUGE:
+		return NULL;
+	case MUIC_INT1 ... MUIC_INT3:
+		return max8997->muic;
+	case GPIO_LOW ... GPIO_HI:
+		return max8997->i2c;
+	case FLASH_STATUS:
+		return max8997->i2c;
+	default:
+		return ERR_PTR(-EINVAL);
+	}
+
+	return ERR_PTR(-EINVAL);
+}
+
+struct max8997_irq_data {
+	int mask;
+	enum max8997_irq_source group;
+};
+
+#define DECLARE_IRQ(idx, _group, _mask)		\
+	[(idx)] = { .group = (_group), .mask = (_mask) }
+static const struct max8997_irq_data max8997_irqs[] = {
+	DECLARE_IRQ(MAX8997_PMICIRQ_PWRONR,	PMIC_INT1, 1 << 0),
+	DECLARE_IRQ(MAX8997_PMICIRQ_PWRONF,	PMIC_INT1, 1 << 1),
+	DECLARE_IRQ(MAX8997_PMICIRQ_PWRON1SEC,	PMIC_INT1, 1 << 3),
+	DECLARE_IRQ(MAX8997_PMICIRQ_JIGONR,	PMIC_INT1, 1 << 4),
+	DECLARE_IRQ(MAX8997_PMICIRQ_JIGONF,	PMIC_INT1, 1 << 5),
+	DECLARE_IRQ(MAX8997_PMICIRQ_LOWBAT2,	PMIC_INT1, 1 << 6),
+	DECLARE_IRQ(MAX8997_PMICIRQ_LOWBAT1,	PMIC_INT1, 1 << 7),
+
+	DECLARE_IRQ(MAX8997_PMICIRQ_JIGR,	PMIC_INT2, 1 << 0),
+	DECLARE_IRQ(MAX8997_PMICIRQ_JIGF,	PMIC_INT2, 1 << 1),
+	DECLARE_IRQ(MAX8997_PMICIRQ_MR,		PMIC_INT2, 1 << 2),
+	DECLARE_IRQ(MAX8997_PMICIRQ_DVS1OK,	PMIC_INT2, 1 << 3),
+	DECLARE_IRQ(MAX8997_PMICIRQ_DVS2OK,	PMIC_INT2, 1 << 4),
+	DECLARE_IRQ(MAX8997_PMICIRQ_DVS3OK,	PMIC_INT2, 1 << 5),
+	DECLARE_IRQ(MAX8997_PMICIRQ_DVS4OK,	PMIC_INT2, 1 << 6),
+
+	DECLARE_IRQ(MAX8997_PMICIRQ_CHGINS,	PMIC_INT3, 1 << 0),
+	DECLARE_IRQ(MAX8997_PMICIRQ_CHGRM,	PMIC_INT3, 1 << 1),
+	DECLARE_IRQ(MAX8997_PMICIRQ_DCINOVP,	PMIC_INT3, 1 << 2),
+	DECLARE_IRQ(MAX8997_PMICIRQ_TOPOFFR,	PMIC_INT3, 1 << 3),
+	DECLARE_IRQ(MAX8997_PMICIRQ_CHGRSTF,	PMIC_INT3, 1 << 5),
+	DECLARE_IRQ(MAX8997_PMICIRQ_MBCHGTMEXPD,	PMIC_INT3, 1 << 7),
+
+	DECLARE_IRQ(MAX8997_PMICIRQ_RTC60S,	PMIC_INT4, 1 << 0),
+	DECLARE_IRQ(MAX8997_PMICIRQ_RTCA1,	PMIC_INT4, 1 << 1),
+	DECLARE_IRQ(MAX8997_PMICIRQ_RTCA2,	PMIC_INT4, 1 << 2),
+	DECLARE_IRQ(MAX8997_PMICIRQ_SMPL_INT,	PMIC_INT4, 1 << 3),
+	DECLARE_IRQ(MAX8997_PMICIRQ_RTC1S,	PMIC_INT4, 1 << 4),
+	DECLARE_IRQ(MAX8997_PMICIRQ_WTSR,	PMIC_INT4, 1 << 5),
+
+	DECLARE_IRQ(MAX8997_MUICIRQ_ADCError,	MUIC_INT1, 1 << 2),
+	DECLARE_IRQ(MAX8997_MUICIRQ_ADCLow,	MUIC_INT1, 1 << 1),
+	DECLARE_IRQ(MAX8997_MUICIRQ_ADC,	MUIC_INT1, 1 << 0),
+
+	DECLARE_IRQ(MAX8997_MUICIRQ_VBVolt,	MUIC_INT2, 1 << 4),
+	DECLARE_IRQ(MAX8997_MUICIRQ_DBChg,	MUIC_INT2, 1 << 3),
+	DECLARE_IRQ(MAX8997_MUICIRQ_DCDTmr,	MUIC_INT2, 1 << 2),
+	DECLARE_IRQ(MAX8997_MUICIRQ_ChgDetRun,	MUIC_INT2, 1 << 1),
+	DECLARE_IRQ(MAX8997_MUICIRQ_ChgTyp,	MUIC_INT2, 1 << 0),
+
+	DECLARE_IRQ(MAX8997_MUICIRQ_OVP,	MUIC_INT3, 1 << 2),
+};
+
+static void max8997_irq_lock(struct irq_data *data)
+{
+	struct max8997_dev *max8997 = get_irq_chip_data(data->irq);
+
+	mutex_lock(&max8997->irqlock);
+}
+
+static void max8997_irq_sync_unlock(struct irq_data *data)
+{
+	struct max8997_dev *max8997 = get_irq_chip_data(data->irq);
+	int i;
+
+	for (i = 0; i < MAX8997_IRQ_GROUP_NR; i++) {
+		u8 mask_reg = max8997_mask_reg[i];
+		struct i2c_client *i2c = get_i2c(max8997, i);
+
+		if (mask_reg == MAX8997_REG_INVALID ||
+				IS_ERR_OR_NULL(i2c))
+			continue;
+		max8997->irq_masks_cache[i] = max8997->irq_masks_cur[i];
+
+		max8997_write_reg(i2c, max8997_mask_reg[i],
+				max8997->irq_masks_cur[i]);
+	}
+
+	mutex_unlock(&max8997->irqlock);
+}
+
+static const inline struct max8997_irq_data *
+irq_to_max8997_irq(struct max8997_dev *max8997, int irq)
+{
+	return &max8997_irqs[irq - max8997->irq_base];
+}
+
+static void max8997_irq_mask(struct irq_data *data)
+{
+	struct max8997_dev *max8997 = get_irq_chip_data(data->irq);
+	const struct max8997_irq_data *irq_data = irq_to_max8997_irq(max8997,
+								data->irq);
+
+	max8997->irq_masks_cur[irq_data->group] |= irq_data->mask;
+}
+
+static void max8997_irq_unmask(struct irq_data *data)
+{
+	struct max8997_dev *max8997 = get_irq_chip_data(data->irq);
+	const struct max8997_irq_data *irq_data = irq_to_max8997_irq(max8997,
+								data->irq);
+
+	max8997->irq_masks_cur[irq_data->group] &= ~irq_data->mask;
+}
+
+static struct irq_chip max8997_irq_chip = {
+	.name			= "max8997",
+	.irq_bus_lock		= max8997_irq_lock,
+	.irq_bus_sync_unlock	= max8997_irq_sync_unlock,
+	.irq_mask		= max8997_irq_mask,
+	.irq_unmask		= max8997_irq_unmask,
+};
+
+#define MAX8997_IRQSRC_PMIC		(1 << 1)
+#define MAX8997_IRQSRC_FUELGAUGE	(1 << 2)
+#define MAX8997_IRQSRC_MUIC		(1 << 3)
+#define MAX8997_IRQSRC_GPIO		(1 << 4)
+#define MAX8997_IRQSRC_FLASH		(1 << 5)
+static irqreturn_t max8997_irq_thread(int irq, void *data)
+{
+	struct max8997_dev *max8997 = data;
+	u8 irq_reg[MAX8997_IRQ_GROUP_NR] = {};
+	u8 irq_src;
+	int ret;
+	int i;
+
+	ret = max8997_read_reg(max8997->i2c, MAX8997_REG_INTSRC, &irq_src);
+	if (ret < 0) {
+		dev_err(max8997->dev, "Failed to read interrupt source: %d\n",
+				ret);
+		return IRQ_NONE;
+	}
+
+	if (irq_src & MAX8997_IRQSRC_PMIC) {
+		/* PMIC INT1 ~ INT4 */
+		max8997_bulk_read(max8997->i2c, MAX8997_REG_INT1, 4,
+				&irq_reg[PMIC_INT1]);
+	}
+	if (irq_src & MAX8997_IRQSRC_FUELGAUGE) {
+		/*
+		 * TODO: FUEL GAUGE
+		 *
+		 * This is to be supported by Max17042 driver. When
+		 * an interrupt incurs here, it should be relayed to a
+		 * Max17042 device that is connected (probably by
+		 * platform-data). However, we do not have interrupt
+		 * handling in Max17042 driver currently. The Max17042 IRQ
+		 * driver should be ready to be used as a stand-alone device and
+		 * a Max8997-dependent device. Because it is not ready in
+		 * Max17042-side and it is not too critical in operating
+		 * Max8997, we do not implement this in initial releases.
+		 */
+		irq_reg[FUEL_GAUGE] = 0;
+	}
+	if (irq_src & MAX8997_IRQSRC_MUIC) {
+		/* MUIC INT1 ~ INT3 */
+		max8997_bulk_read(max8997->muic, MAX8997_MUIC_REG_INT1, 3,
+				&irq_reg[MUIC_INT1]);
+	}
+	if (irq_src & MAX8997_IRQSRC_GPIO) {
+		/* GPIO Interrupt */
+		u8 gpio_info[MAX8997_NUM_GPIO];
+
+		irq_reg[GPIO_LOW] = 0;
+		irq_reg[GPIO_HI] = 0;
+
+		max8997_bulk_read(max8997->i2c, MAX8997_REG_GPIOCNTL1,
+				MAX8997_NUM_GPIO, gpio_info);
+		for (i = 0; i < MAX8997_NUM_GPIO; i++) {
+			bool interrupt = false;
+
+			switch (gpio_info[i] & MAX8997_GPIO_INT_MASK) {
+			case MAX8997_GPIO_INT_BOTH:
+				if (max8997->gpio_status[i] != gpio_info[i])
+					interrupt = true;
+				break;
+			case MAX8997_GPIO_INT_RISE:
+				if ((max8997->gpio_status[i] != gpio_info[i]) &&
+				    (gpio_info[i] & MAX8997_GPIO_DATA_MASK))
+					interrupt = true;
+				break;
+			case MAX8997_GPIO_INT_FALL:
+				if ((max8997->gpio_status[i] != gpio_info[i]) &&
+				    !(gpio_info[i] & MAX8997_GPIO_DATA_MASK))
+					interrupt = true;
+				break;
+			default:
+				break;
+			}
+
+			if (interrupt) {
+				if (i < 8)
+					irq_reg[GPIO_LOW] |= (1 << i);
+				else
+					irq_reg[GPIO_HI] |= (1 << (i - 8));
+			}
+
+		}
+	}
+	if (irq_src & MAX8997_IRQSRC_FLASH) {
+		/* Flash Status Interrupt */
+		ret = max8997_read_reg(max8997->i2c, MAX8997_REG_FLASHSTATUS,
+				&irq_reg[FLASH_STATUS]);
+	}
+
+	/* Apply masking */
+	for (i = 0; i < MAX8997_IRQ_GROUP_NR; i++)
+		irq_reg[i] &= ~max8997->irq_masks_cur[i];
+
+	/* Report */
+	for (i = 0; i < MAX8997_IRQ_NR; i++) {
+		if (irq_reg[max8997_irqs[i].group] & max8997_irqs[i].mask)
+			handle_nested_irq(max8997->irq_base + i);
+	}
+
+	return IRQ_HANDLED;
+}
+
+int max8997_irq_resume(struct max8997_dev *max8997)
+{
+	if (max8997->irq && max8997->irq_base)
+		max8997_irq_thread(max8997->irq_base, max8997);
+	return 0;
+}
+
+int max8997_irq_init(struct max8997_dev *max8997)
+{
+	int i;
+	int cur_irq;
+	int ret;
+	u8 val;
+
+	if (!max8997->irq) {
+		dev_warn(max8997->dev, "No interrupt specified.\n");
+		max8997->irq_base = 0;
+		return 0;
+	}
+
+	if (!max8997->irq_base) {
+		dev_err(max8997->dev, "No interrupt base specified.\n");
+		return 0;
+	}
+
+	mutex_init(&max8997->irqlock);
+
+	/* Mask individual interrupt sources */
+	for (i = 0; i < MAX8997_IRQ_GROUP_NR; i++) {
+		struct i2c_client *i2c;
+
+		max8997->irq_masks_cur[i] = 0xff;
+		max8997->irq_masks_cache[i] = 0xff;
+		i2c = get_i2c(max8997, i);
+
+		if (IS_ERR_OR_NULL(i2c))
+			continue;
+		if (max8997_mask_reg[i] == MAX8997_REG_INVALID)
+			continue;
+
+		max8997_write_reg(i2c, max8997_mask_reg[i], 0xff);
+	}
+
+	for (i = 0; i < MAX8997_NUM_GPIO; i++) {
+		max8997->gpio_status[i] = (max8997_read_reg(max8997->i2c,
+						MAX8997_REG_GPIOCNTL1 + i,
+						&val)
+					& MAX8997_GPIO_DATA_MASK) ?
+					true : false;
+	}
+
+	/* Register with genirq */
+	for (i = 0; i < MAX8997_IRQ_NR; i++) {
+		cur_irq = i + max8997->irq_base;
+		set_irq_chip_data(cur_irq, max8997);
+		set_irq_chip_and_handler(cur_irq, &max8997_irq_chip,
+				handle_edge_irq);
+		set_irq_nested_thread(cur_irq, 1);
+#ifdef CONFIG_ARM
+		set_irq_flags(cur_irq, IRQF_VALID);
+#else
+		set_irq_noprobe(cur_irq);
+#endif
+	}
+
+	ret = request_threaded_irq(max8997->irq, NULL, max8997_irq_thread,
+			IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+			"max8997-irq", max8997);
+
+	if (ret) {
+		dev_err(max8997->dev, "Failed to request IRQ %d: %d\n",
+				max8997->irq, ret);
+		return ret;
+	}
+
+	if (!max8997->ono)
+		return 0;
+
+	ret = request_threaded_irq(max8997->ono, NULL, max8997_irq_thread,
+			IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING |
+			IRQF_ONESHOT, "max8997-ono", max8997);
+
+	if (ret)
+		dev_err(max8997->dev, "Failed to request ono-IRQ %d: %d\n",
+				max8997->ono, ret);
+
+	return 0;
+}
+
+void max8997_irq_exit(struct max8997_dev *max8997)
+{
+	if (max8997->ono)
+		free_irq(max8997->ono, max8997);
+
+	if (max8997->irq)
+		free_irq(max8997->irq, max8997);
+}
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h
index 93a9477..69d1010 100644
--- a/include/linux/mfd/max8997-private.h
+++ b/include/linux/mfd/max8997-private.h
@@ -24,6 +24,8 @@
 
 #include <linux/i2c.h>
 
+#define MAX8997_REG_INVALID	(0xff)
+
 enum max8997_pmic_reg {
 	MAX8997_REG_PMIC_ID0	= 0x00,
 	MAX8997_REG_PMIC_ID1	= 0x01,
@@ -313,6 +315,7 @@ enum max8997_irq {
 #define MAX8997_REG_BUCK2DVS(x)	(MAX8997_REG_BUCK2DVS1 + (x) - 1)
 #define MAX8997_REG_BUCK5DVS(x)	(MAX8997_REG_BUCK5DVS1 + (x) - 1)
 
+#define MAX8997_NUM_GPIO	12
 struct max8997_dev {
 	struct device *dev;
 	struct i2c_client *i2c; /* 0xcc / PMIC, Battery Control, and FLASH */
@@ -324,11 +327,19 @@ struct max8997_dev {
 	int type;
 	struct platform_device *battery; /* battery control (not fuel gauge) */
 
+	int irq;
+	int ono;
+	int irq_base;
 	bool wakeup;
+	struct mutex irqlock;
+	int irq_masks_cur[MAX8997_IRQ_GROUP_NR];
+	int irq_masks_cache[MAX8997_IRQ_GROUP_NR];
 
 	/* For hibernation */
 	u8 reg_dump[MAX8997_REG_PMIC_END + MAX8997_MUIC_REG_END +
 		MAX8997_HAPTIC_REG_END];
+
+	bool gpio_status[MAX8997_NUM_GPIO];
 };
 
 enum max8997_types {
@@ -336,6 +347,10 @@ enum max8997_types {
 	TYPE_MAX8966,
 };
 
+extern int max8997_irq_init(struct max8997_dev *max8997);
+extern void max8997_irq_exit(struct max8997_dev *max8997);
+extern int max8997_irq_resume(struct max8997_dev *max8997);
+
 extern int max8997_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest);
 extern int max8997_bulk_read(struct i2c_client *i2c, u8 reg, int count,
 				u8 *buf);
@@ -344,4 +359,10 @@ extern int max8997_bulk_write(struct i2c_client *i2c, u8 reg, int count,
 				u8 *buf);
 extern int max8997_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask);
 
+#define MAX8997_GPIO_INT_BOTH	(0x3 << 4)
+#define MAX8997_GPIO_INT_RISE	(0x2 << 4)
+#define MAX8997_GPIO_INT_FALL	(0x1 << 4)
+
+#define MAX8997_GPIO_INT_MASK	(0x3 << 4)
+#define MAX8997_GPIO_DATA_MASK	(0x1 << 2)
 #endif /*  __LINUX_MFD_MAX8997_PRIV_H */
diff --git a/include/linux/mfd/max8997.h b/include/linux/mfd/max8997.h
index cb671b3..60931d0 100644
--- a/include/linux/mfd/max8997.h
+++ b/include/linux/mfd/max8997.h
@@ -78,8 +78,11 @@ struct max8997_regulator_data {
 };
 
 struct max8997_platform_data {
-	bool wakeup;
-	/* IRQ: Not implemented */
+	/* IRQ */
+	int irq_base;
+	int ono;
+	int wakeup;
+
 	/* ---- PMIC ---- */
 	struct max8997_regulator_data *regulators;
 	int num_regulators;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* RE: linux-next: build failure after merge of the final tree (mfd tree related)
  2013-06-19  8:24 ` Samuel Ortiz
@ 2013-06-20  2:25   ` Chao Xie
  0 siblings, 0 replies; 24+ messages in thread
From: Chao Xie @ 2013-06-20  2:25 UTC (permalink / raw)
  To: Samuel Ortiz, Stephen Rothwell; +Cc: linux-next, linux-kernel, Yi Zhang

> -----Original Message-----
> From: Samuel Ortiz [mailto:sameo@linux.intel.com] 
> Sent: Wednesday, June 19, 2013 4:25 PM
> To: Stephen Rothwell
> Cc: linux-next@vger.kernel.org; linux-kernel@vger.kernel.org; Chao Xie; Yi Zhang
> Subject: Re: linux-next: build failure after merge of the final tree (mfd tree related)

> Hi Stephen,

>>On Tue, Jun 18, 2013 at 05:19:57PM +1000, Stephen Rothwell wrote:
>> Hi all,
>> 
>> After merging the final tree, today's linux-next build (powerpc
>> allyesconfig) failed like this:
>> 
>> drivers/mfd/88pm800.c: In function 'pm800_pages_init':
>> drivers/mfd/88pm800.c:434:2: error: implicit declaration of function 'IS_ERR' [-Werror=implicit-function-declaration]
>>   if (IS_ERR(subchip->regmap_power)) {
>>   ^
>> drivers/mfd/88pm800.c:435:3: error: implicit declaration of function 'PTR_ERR' [-Werror=implicit-function-declaration]
>>    ret = PTR_ERR(subchip->regmap_power);
>>    ^
>> 
>> Caused by commit f8ca616f67f7 ("mfd: 88pm800: Enhance error handling for
>> sub pages probe/remove") from the mfd tree.  Forgot to include
>> linux/err.h (see Rule 1 in Documentation/SubmitChecklist).
>Sorry about that. This is fixed now.

It is my fault. Thanks for fixing it.

> Cheers,
> Samuel.

> -- 
> Intel Open Source Technology Centre
> http://oss.intel.com/

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: linux-next: build failure after merge of the final tree (mfd tree related)
  2013-06-18  7:19 linux-next: build failure after merge of the final tree (mfd tree related) Stephen Rothwell
@ 2013-06-19  8:24 ` Samuel Ortiz
  2013-06-20  2:25   ` Chao Xie
  0 siblings, 1 reply; 24+ messages in thread
From: Samuel Ortiz @ 2013-06-19  8:24 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Chao Xie, Yi Zhang

Hi Stephen,

On Tue, Jun 18, 2013 at 05:19:57PM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the final tree, today's linux-next build (powerpc
> allyesconfig) failed like this:
> 
> drivers/mfd/88pm800.c: In function 'pm800_pages_init':
> drivers/mfd/88pm800.c:434:2: error: implicit declaration of function 'IS_ERR' [-Werror=implicit-function-declaration]
>   if (IS_ERR(subchip->regmap_power)) {
>   ^
> drivers/mfd/88pm800.c:435:3: error: implicit declaration of function 'PTR_ERR' [-Werror=implicit-function-declaration]
>    ret = PTR_ERR(subchip->regmap_power);
>    ^
> 
> Caused by commit f8ca616f67f7 ("mfd: 88pm800: Enhance error handling for
> sub pages probe/remove") from the mfd tree.  Forgot to include
> linux/err.h (see Rule 1 in Documentation/SubmitChecklist).
Sorry about that. This is fixed now.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 24+ messages in thread

* linux-next: build failure after merge of the final tree (mfd tree related)
@ 2013-06-18  7:19 Stephen Rothwell
  2013-06-19  8:24 ` Samuel Ortiz
  0 siblings, 1 reply; 24+ messages in thread
From: Stephen Rothwell @ 2013-06-18  7:19 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-next, linux-kernel, Chao Xie, Yi Zhang

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

Hi all,

After merging the final tree, today's linux-next build (powerpc
allyesconfig) failed like this:

drivers/mfd/88pm800.c: In function 'pm800_pages_init':
drivers/mfd/88pm800.c:434:2: error: implicit declaration of function 'IS_ERR' [-Werror=implicit-function-declaration]
  if (IS_ERR(subchip->regmap_power)) {
  ^
drivers/mfd/88pm800.c:435:3: error: implicit declaration of function 'PTR_ERR' [-Werror=implicit-function-declaration]
   ret = PTR_ERR(subchip->regmap_power);
   ^

Caused by commit f8ca616f67f7 ("mfd: 88pm800: Enhance error handling for
sub pages probe/remove") from the mfd tree.  Forgot to include
linux/err.h (see Rule 1 in Documentation/SubmitChecklist).

I have reverted that commit for today.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: linux-next: build failure after merge of the final tree (mfd tree related)
  2012-09-17 11:38 Stephen Rothwell
@ 2012-09-17 13:28 ` Samuel Ortiz
  0 siblings, 0 replies; 24+ messages in thread
From: Samuel Ortiz @ 2012-09-17 13:28 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Gyungoh Yoo, Stephen Warren

Hi Stephen,

On Mon, Sep 17, 2012 at 09:38:33PM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the final tree, today's linux-next build (powerpc
> allyesconfig) failed like this:
> 
> drivers/mfd/max8907.c: In function 'max8907_i2c_probe':
> drivers/mfd/max8907.c:248:10: error: too few arguments to function 'mfd_add_devices'
> include/linux/mfd/core.h:100:12: note: declared here
> 
> Caused by commit 6c2591532a6f ("mfd: Add MAX8907 core driver") from the
> mfd tree interacting with commit 0848c94fb4a5 ("mfd: core: Push irqdomain
> mapping out into devices") from Linus' tree.
My bad. And Stephen even warned me about it...
It should be all fixed now, sorry about that.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 24+ messages in thread

* linux-next: build failure after merge of the final tree (mfd tree related)
@ 2012-09-17 11:38 Stephen Rothwell
  2012-09-17 13:28 ` Samuel Ortiz
  0 siblings, 1 reply; 24+ messages in thread
From: Stephen Rothwell @ 2012-09-17 11:38 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-next, linux-kernel, Gyungoh Yoo, Stephen Warren

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

Hi all,

After merging the final tree, today's linux-next build (powerpc
allyesconfig) failed like this:

drivers/mfd/max8907.c: In function 'max8907_i2c_probe':
drivers/mfd/max8907.c:248:10: error: too few arguments to function 'mfd_add_devices'
include/linux/mfd/core.h:100:12: note: declared here

Caused by commit 6c2591532a6f ("mfd: Add MAX8907 core driver") from the
mfd tree interacting with commit 0848c94fb4a5 ("mfd: core: Push irqdomain
mapping out into devices") from Linus' tree.

I have added the following patch and will carry it as a merge fix:

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 17 Sep 2012 21:31:20 +1000
Subject: [PATCH] mfd: fix up for mfd_add_devices() API change

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/mfd/max8907.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/max8907.c b/drivers/mfd/max8907.c
index 5295276..6497c98 100644
--- a/drivers/mfd/max8907.c
+++ b/drivers/mfd/max8907.c
@@ -245,7 +245,7 @@ static __devinit int max8907_i2c_probe(struct i2c_client *i2c,
 	enable_irq(max8907->i2c_gen->irq);
 
 	ret = mfd_add_devices(max8907->dev, -1, max8907_cells,
-			      ARRAY_SIZE(max8907_cells), NULL, 0);
+			      ARRAY_SIZE(max8907_cells), NULL, 0, NULL);
 	if (ret != 0) {
 		dev_err(&i2c->dev, "failed to add MFD devices %d\n", ret);
 		goto err_add_devices;
-- 
1.7.10.280.gaa39

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: linux-next: build failure after merge of the final tree (mfd tree related)
  2011-12-21  6:33 Stephen Rothwell
  2011-12-21 10:51 ` Cousson, Benoit
@ 2011-12-22 17:30 ` Samuel Ortiz
  1 sibling, 0 replies; 24+ messages in thread
From: Samuel Ortiz @ 2011-12-22 17:30 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Benoit Cousson

Hi Stephen,

On Wed, Dec 21, 2011 at 05:33:01PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the final tree, today's linux-next build (powerpc
> allyesconfig) failed like this:
> 
> drivers/mfd/twl-core.c: In function 'twl_probe':
> drivers/mfd/twl-core.c:1212:22: error: 'TWL6030_IRQ_BASE' undeclared (first use in this function)
> drivers/mfd/twl-core.c:1212:22: note: each undeclared identifier is reported only once for each function it appears in
> drivers/mfd/twl-core.c:1213:39: error: 'TWL6030_BASE_NR_IRQS' undeclared (first use in this function)
> drivers/mfd/twl-core.c:1215:22: error: 'TWL4030_IRQ_BASE' undeclared (first use in this function)
> drivers/mfd/twl-core.c:1216:39: error: 'TWL4030_BASE_NR_IRQS' undeclared (first use in this function)
> drivers/mfd/twl-core.c:1218:3: error: implicit declaration of function 'irq_domain_add_simple' [-Werror=implicit-function-declaration]
> 
> Caused by commit 4eea8b1d717d ("mfd: Add initial DT support for
> twl4030/twl6030").  A missing include?  Or a CONFIG problem?
> 
> This build does not have CONFIG_IRQ_DOMAIN set.
> 
> I have reverted that commit for today.
I just pushed Benoit's new patch, this build failure should be fixed now.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: linux-next: build failure after merge of the final tree (mfd tree related)
  2011-12-21 10:51 ` Cousson, Benoit
@ 2011-12-21 12:24   ` Samuel Ortiz
  0 siblings, 0 replies; 24+ messages in thread
From: Samuel Ortiz @ 2011-12-21 12:24 UTC (permalink / raw)
  To: Cousson, Benoit; +Cc: Stephen Rothwell, linux-next, linux-kernel

Hi Benoit,

On Wed, Dec 21, 2011 at 11:51:27AM +0100, Cousson, Benoit wrote:
> Hi Stephen,
> 
> On 12/21/2011 7:33 AM, Stephen Rothwell wrote:
> >Hi all,
> >
> >After merging the final tree, today's linux-next build (powerpc
> >allyesconfig) failed like this:
> >
> >drivers/mfd/twl-core.c: In function 'twl_probe':
> >drivers/mfd/twl-core.c:1212:22: error: 'TWL6030_IRQ_BASE' undeclared (first use in this function)
> >drivers/mfd/twl-core.c:1212:22: note: each undeclared identifier is reported only once for each function it appears in
> >drivers/mfd/twl-core.c:1213:39: error: 'TWL6030_BASE_NR_IRQS' undeclared (first use in this function)
> >drivers/mfd/twl-core.c:1215:22: error: 'TWL4030_IRQ_BASE' undeclared (first use in this function)
> >drivers/mfd/twl-core.c:1216:39: error: 'TWL4030_BASE_NR_IRQS' undeclared (first use in this function)
> >drivers/mfd/twl-core.c:1218:3: error: implicit declaration of function 'irq_domain_add_simple' [-Werror=implicit-function-declaration]
> >
> >Caused by commit 4eea8b1d717d ("mfd: Add initial DT support for
> >twl4030/twl6030").  A missing include?  Or a CONFIG problem?
> 
> Both in fact...
> 
> There are some nasty dependencies with that TWL driver and the IRQ
> defined in OMAP headers only. I was fooled by the name of these
> macros.
> I naively thought this could be fixed later as written in the
> comment I added. I appears this is not the case :-(.
> 
> >This build does not have CONFIG_IRQ_DOMAIN set.
> 
> Ooops, I was not aware of that domain CONFIG. That one is an easy fix.
> 
> 
> Samuel,
> 
> Just let me know if you will have time for an updated version before Xmas.
I have time to merge an updated version, yes.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: linux-next: build failure after merge of the final tree (mfd tree related)
  2011-12-21  6:33 Stephen Rothwell
@ 2011-12-21 10:51 ` Cousson, Benoit
  2011-12-21 12:24   ` Samuel Ortiz
  2011-12-22 17:30 ` Samuel Ortiz
  1 sibling, 1 reply; 24+ messages in thread
From: Cousson, Benoit @ 2011-12-21 10:51 UTC (permalink / raw)
  To: Stephen Rothwell, Samuel Ortiz; +Cc: linux-next, linux-kernel

Hi Stephen,

On 12/21/2011 7:33 AM, Stephen Rothwell wrote:
> Hi all,
>
> After merging the final tree, today's linux-next build (powerpc
> allyesconfig) failed like this:
>
> drivers/mfd/twl-core.c: In function 'twl_probe':
> drivers/mfd/twl-core.c:1212:22: error: 'TWL6030_IRQ_BASE' undeclared (first use in this function)
> drivers/mfd/twl-core.c:1212:22: note: each undeclared identifier is reported only once for each function it appears in
> drivers/mfd/twl-core.c:1213:39: error: 'TWL6030_BASE_NR_IRQS' undeclared (first use in this function)
> drivers/mfd/twl-core.c:1215:22: error: 'TWL4030_IRQ_BASE' undeclared (first use in this function)
> drivers/mfd/twl-core.c:1216:39: error: 'TWL4030_BASE_NR_IRQS' undeclared (first use in this function)
> drivers/mfd/twl-core.c:1218:3: error: implicit declaration of function 'irq_domain_add_simple' [-Werror=implicit-function-declaration]
>
> Caused by commit 4eea8b1d717d ("mfd: Add initial DT support for
> twl4030/twl6030").  A missing include?  Or a CONFIG problem?

Both in fact...

There are some nasty dependencies with that TWL driver and the IRQ 
defined in OMAP headers only. I was fooled by the name of these macros.
I naively thought this could be fixed later as written in the comment I 
added. I appears this is not the case :-(.

> This build does not have CONFIG_IRQ_DOMAIN set.

Ooops, I was not aware of that domain CONFIG. That one is an easy fix.


Samuel,

Just let me know if you will have time for an updated version before Xmas.
I'll try to fix that by using irq_alloc_descs to avoid these hard-coded 
macros. It might conflict with the still hard coded GPIO IRQs range, but 
I'll see if it work for DT only at least.


Thanks,
Benoit

^ permalink raw reply	[flat|nested] 24+ messages in thread

* linux-next: build failure after merge of the final tree (mfd tree related)
@ 2011-12-21  6:33 Stephen Rothwell
  2011-12-21 10:51 ` Cousson, Benoit
  2011-12-22 17:30 ` Samuel Ortiz
  0 siblings, 2 replies; 24+ messages in thread
From: Stephen Rothwell @ 2011-12-21  6:33 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-next, linux-kernel, Benoit Cousson

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

Hi all,

After merging the final tree, today's linux-next build (powerpc
allyesconfig) failed like this:

drivers/mfd/twl-core.c: In function 'twl_probe':
drivers/mfd/twl-core.c:1212:22: error: 'TWL6030_IRQ_BASE' undeclared (first use in this function)
drivers/mfd/twl-core.c:1212:22: note: each undeclared identifier is reported only once for each function it appears in
drivers/mfd/twl-core.c:1213:39: error: 'TWL6030_BASE_NR_IRQS' undeclared (first use in this function)
drivers/mfd/twl-core.c:1215:22: error: 'TWL4030_IRQ_BASE' undeclared (first use in this function)
drivers/mfd/twl-core.c:1216:39: error: 'TWL4030_BASE_NR_IRQS' undeclared (first use in this function)
drivers/mfd/twl-core.c:1218:3: error: implicit declaration of function 'irq_domain_add_simple' [-Werror=implicit-function-declaration]

Caused by commit 4eea8b1d717d ("mfd: Add initial DT support for
twl4030/twl6030").  A missing include?  Or a CONFIG problem?

This build does not have CONFIG_IRQ_DOMAIN set.

I have reverted that commit for today.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* linux-next: build failure after merge of the final tree (mfd tree related)
@ 2011-03-28  3:52 Stephen Rothwell
  0 siblings, 0 replies; 24+ messages in thread
From: Stephen Rothwell @ 2011-03-28  3:52 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-next, linux-kernel, Andres Salomon

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

Hi all,

After merging the final tree, today's linux-next build (powerpc
allyesconfig) failed like this:

drivers/mfd/cs5535-mfd.c:30:22: error: asm/olpc.h: No such file or directory

Caused by commit fa1df691688f ("mfd: Add mfd_clone_cell(), convert
cs5535-mfd/olpc-xo1 to it").

I have reverted that commit (and commit adfa4bd4a8bf "mfd: OLPC: Clean up
names to match what OLPC actually uses" that conflicted with the revert).
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: linux-next: build failure after merge of the final tree (mfd tree related)
@ 2011-03-21  8:12 함명주
  0 siblings, 0 replies; 24+ messages in thread
From: 함명주 @ 2011-03-21  8:12 UTC (permalink / raw)
  To: Stephen Rothwell, Samuel Ortiz
  Cc: linux-next, linux-kernel, 박경민

> Sender : Stephen Rothwell<sfr@canb.auug.org.au>
> Date : 2011-03-21 11:59 (GMT+09:00)
> Title : linux-next: build failure after merge of the final tree (mfd tree related)
> 
> Hi Sam,
> 
> After merging the final tree, today's linux-next build (powerpc
> allyesconfig) failed like this:
> 
> drivers/mfd/max8997-irq.c:170: error: unknown field 'bus_lock' specified in initializer
> drivers/mfd/max8997-irq.c:170: warning: initialization from incompatible pointer type
> drivers/mfd/max8997-irq.c:171: error: unknown field 'bus_sync_unlock' specified in initializer
> drivers/mfd/max8997-irq.c:171: warning: initialization from incompatible pointer type
> drivers/mfd/max8997-irq.c:172: error: unknown field 'mask' specified in initializer
> drivers/mfd/max8997-irq.c:172: warning: initialization from incompatible pointer type
> drivers/mfd/max8997-irq.c:173: error: unknown field 'unmask' specified in initializer
> drivers/mfd/max8997-irq.c:173: warning: initialization from incompatible pointer type
> 
> Caused by commit d7d21d394c9d ("mfd: Add MAX8997/8966 IRQ control feature").
> 
> The presence of these fields depends on
> CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED not being set.
> 
> I have reverted that commit for today.

Hello Stephen,

I've just submitted a corrected patch that works with
CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED being either set or unset.
Because it appears that we still have targets with deprecated functions,
I left the deprecated functions working as well as the new ones.

Thank you.

- MyungJoo.
> -- 
> Cheers,
> Stephen Rothwell                    sfr@canb.auug.org.au
> http://www.canb.auug.org.au/~sfr/
> 
>


 MyungJoo Ham (함명주)
Mobile Software Platform Lab,
Digital Media and Communications (DMC) Business
Samsung Electronics
cell: +82-10-6714-2858 / office: +82-31-279-8033

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: linux-next: build failure after merge of the final tree (mfd tree related)
  2010-12-20 10:52   ` Mark Brown
@ 2010-12-20 12:18     ` Mark Brown
  0 siblings, 0 replies; 24+ messages in thread
From: Mark Brown @ 2010-12-20 12:18 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: Stephen Rothwell, linux-next, linux-kernel

On Mon, Dec 20, 2010 at 10:52:03AM +0000, Mark Brown wrote:
> On Mon, Dec 20, 2010 at 11:33:37AM +0100, Samuel Ortiz wrote:

> > Ok, I removed Mark's commit, the MFD tree should build fine now.
> > I'm keeping this one for whenever we'll have a proper pwm framework.

> It doesn't need dropping I think, the driver should just need a
> dependency on HAVE_PWM adding.

Meh, sorry, wrong way round.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: linux-next: build failure after merge of the final tree (mfd tree related)
  2010-12-20 10:33 ` Samuel Ortiz
@ 2010-12-20 10:52   ` Mark Brown
  2010-12-20 12:18     ` Mark Brown
  0 siblings, 1 reply; 24+ messages in thread
From: Mark Brown @ 2010-12-20 10:52 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: Stephen Rothwell, linux-next, linux-kernel

On Mon, Dec 20, 2010 at 11:33:37AM +0100, Samuel Ortiz wrote:
> On Mon, Dec 20, 2010 at 07:21:21PM +1100, Stephen Rothwell wrote:

> > After merging the final tree, today's linux-next build (powerpc
> > allyesconfig) failed like this:

> Ok, I removed Mark's commit, the MFD tree should build fine now.
> I'm keeping this one for whenever we'll have a proper pwm framework.

It doesn't need dropping I think, the driver should just need a
dependency on HAVE_PWM adding.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: linux-next: build failure after merge of the final tree (mfd tree related)
  2010-12-20  8:21 Stephen Rothwell
@ 2010-12-20 10:33 ` Samuel Ortiz
  2010-12-20 10:52   ` Mark Brown
  0 siblings, 1 reply; 24+ messages in thread
From: Samuel Ortiz @ 2010-12-20 10:33 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Mark Brown

Hi Stephen,

On Mon, Dec 20, 2010 at 07:21:21PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the final tree, today's linux-next build (powerpc
> allyesconfig) failed like this:
Ok, I removed Mark's commit, the MFD tree should build fine now.
I'm keeping this one for whenever we'll have a proper pwm framework.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 24+ messages in thread

* linux-next: build failure after merge of the final tree (mfd tree related)
@ 2010-12-20  8:21 Stephen Rothwell
  2010-12-20 10:33 ` Samuel Ortiz
  0 siblings, 1 reply; 24+ messages in thread
From: Stephen Rothwell @ 2010-12-20  8:21 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-next, linux-kernel, Mark Brown

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

Hi all,

After merging the final tree, today's linux-next build (powerpc
allyesconfig) failed like this:

drivers/mfd/built-in.o: In function `__crc_pwm_free':
(*ABS*+0x24ba6d1e): multiple definition of `__crc_pwm_free'
drivers/mfd/built-in.o: In function `.pwm_free':
(.text+0x1a2bc): multiple definition of `.pwm_free'
drivers/misc/built-in.o:(.text+0x32e40): first defined here
drivers/mfd/built-in.o: In function `__crc_pwm_request':
(*ABS*+0xc1f4ec93): multiple definition of `__crc_pwm_request'
drivers/mfd/built-in.o: In function `__crc_pwm_enable':
(*ABS*+0x9d09808d): multiple definition of `__crc_pwm_enable'
drivers/mfd/built-in.o: In function `.pwm_enable':
(.text+0x1a348): multiple definition of `.pwm_enable'
drivers/misc/built-in.o:(.text+0x32eac): first defined here
drivers/mfd/built-in.o: In function `.pwm_request':
(.text+0x19ff4): multiple definition of `.pwm_request'
drivers/misc/built-in.o:(.text+0x32c80): first defined here
drivers/mfd/built-in.o: In function `pwm_config':
(.opd+0x1e48): multiple definition of `pwm_config'
drivers/misc/built-in.o:(.opd+0x4158): first defined here
drivers/mfd/built-in.o: In function `pwm_free':
(.opd+0x1e90): multiple definition of `pwm_free'
drivers/misc/built-in.o:(.opd+0x4128): first defined here
drivers/mfd/built-in.o: In function `pwm_request':
(.opd+0x1e60): multiple definition of `pwm_request'
drivers/misc/built-in.o:(.opd+0x40b0): first defined here
drivers/mfd/built-in.o: In function `__crc_pwm_disable':
(*ABS*+0xb0493b18): multiple definition of `__crc_pwm_disable'
drivers/mfd/built-in.o: In function `.pwm_disable':
(.text+0x1a1a4): multiple definition of `.pwm_disable'
drivers/misc/built-in.o:(.text+0x32d70): first defined here
drivers/mfd/built-in.o: In function `pwm_enable':
(.opd+0x1ea8): multiple definition of `pwm_enable'
drivers/misc/built-in.o:(.opd+0x4140): first defined here
drivers/mfd/built-in.o: In function `.pwm_config':
(.text+0x19ec8): multiple definition of `.pwm_config'
drivers/misc/built-in.o:(.text+0x32f8c): first defined here
drivers/mfd/built-in.o: In function `pwm_disable':
(.opd+0x1e78): multiple definition of `pwm_disable'
drivers/misc/built-in.o:(.opd+0x4110): first defined here
drivers/mfd/built-in.o: In function `__crc_pwm_config':
(*ABS*+0xc23f5b9): multiple definition of `__crc_pwm_config'

Probably caused by commit 665ba7cafa19e2e2596ace30edc75ebec882e82d ("mfd:
Remove ARCH_U8500 dependency from AB8500") which allowed this driver to
be built in on PowerPC ...

Some of the above symbols are global in more than one place in our code ...

I have reverted that commit for today.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: linux-next: build failure after merge of the final tree (mfd tree related)
  2010-09-16  7:23   ` Stephen Rothwell
@ 2010-09-16  8:51     ` Stephen Rothwell
  0 siblings, 0 replies; 24+ messages in thread
From: Stephen Rothwell @ 2010-09-16  8:51 UTC (permalink / raw)
  To: Arun MURTHY
  Cc: Samuel Ortiz, linux-next, linux-kernel, Linus WALLEIJ,
	Mattias WALLIN, Srinidhi KASAGAR

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

Hi Arun,

On Thu, 16 Sep 2010 17:23:22 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> > Please find the patch that fixes this build issue @ 
> > http://git.kernel.org/?p=linux/kernel/git/sameo/mfd-2.6.git;a=commit;h=f33bd494862cdc519db1f5d9b3f8214a1dd4c1ff
> 
> That patch was in the tree that produced the error above.  The patch you
> quote is a fix for a different build problem.

Oops, wrong error.  I need to read better.  Ignore this.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: linux-next: build failure after merge of the final tree (mfd tree related)
  2010-09-16  7:15 ` Arun MURTHY
@ 2010-09-16  7:23   ` Stephen Rothwell
  2010-09-16  8:51     ` Stephen Rothwell
  0 siblings, 1 reply; 24+ messages in thread
From: Stephen Rothwell @ 2010-09-16  7:23 UTC (permalink / raw)
  To: Arun MURTHY
  Cc: Samuel Ortiz, linux-next, linux-kernel, Linus WALLEIJ,
	Mattias WALLIN, Srinidhi KASAGAR

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

Hi Arun,

On Thu, 16 Sep 2010 09:15:22 +0200 Arun MURTHY <arun.murthy@stericsson.com> wrote:
>
> > > After merging the final tree, today's linux-next build (powerpc
> > > allyesconfig) failed like this:
> > >
> > > drivers/mfd/built-in.o: In function `__crc_pwm_free':
> > > (*ABS*+0x24ba6d1e): multiple definition of `__crc_pwm_free'
> > > drivers/mfd/built-in.o: In function `.pwm_free':
> > > (.text+0x1ab3c): multiple definition of `.pwm_free'
> > > drivers/misc/built-in.o:(.text+0x2620c): first defined here
> > > drivers/mfd/built-in.o: In function `__crc_pwm_request':
> > > (*ABS*+0xc1f4ec93): multiple definition of `__crc_pwm_request'
> > > drivers/mfd/built-in.o: In function `__crc_pwm_enable':
> > > (*ABS*+0x9d09808d): multiple definition of `__crc_pwm_enable'
> > > drivers/mfd/built-in.o: In function `.pwm_enable':
> > > (.text+0x1abc8): multiple definition of `.pwm_enable'
> > > drivers/misc/built-in.o:(.text+0x26278): first defined here
> > > drivers/mfd/built-in.o: In function `.pwm_request':
> > > (.text+0x1a774): multiple definition of `.pwm_request'
> > > drivers/misc/built-in.o:(.text+0x2604c): first defined here
> > > drivers/mfd/built-in.o: In function `pwm_config':
> > > (.opd+0x1ce0): multiple definition of `pwm_config'
> > > drivers/misc/built-in.o:(.opd+0x3000): first defined here
> > > drivers/mfd/built-in.o: In function `pwm_free':
> > > (.opd+0x1d28): multiple definition of `pwm_free'
> > > drivers/misc/built-in.o:(.opd+0x2fd0): first defined here
> > > drivers/mfd/built-in.o: In function `pwm_request':
> > > (.opd+0x1cf8): multiple definition of `pwm_request'
> > > drivers/misc/built-in.o:(.opd+0x2f58): first defined here
> > > drivers/mfd/built-in.o: In function `__crc_pwm_disable':
> > > (*ABS*+0xb0493b18): multiple definition of `__crc_pwm_disable'
> > > drivers/mfd/built-in.o: In function `.pwm_disable':
> > > (.text+0x1aa24): multiple definition of `.pwm_disable'
> > > drivers/misc/built-in.o:(.text+0x2613c): first defined here
> > > drivers/mfd/built-in.o: In function `pwm_enable':
> > > (.opd+0x1d40): multiple definition of `pwm_enable'
> > > drivers/misc/built-in.o:(.opd+0x2fe8): first defined here
> > > drivers/mfd/built-in.o: In function `.pwm_config':
> > > (.text+0x1a648): multiple definition of `.pwm_config'
> > > drivers/misc/built-in.o:(.text+0x26358): first defined here
> > > drivers/mfd/built-in.o: In function `pwm_disable':
> > > (.opd+0x1d10): multiple definition of `pwm_disable'
> > > drivers/misc/built-in.o:(.opd+0x2fb8): first defined here
> > > drivers/mfd/built-in.o: In function `__crc_pwm_config':
> > > (*ABS*+0xc23f5b9): multiple definition of `__crc_pwm_config'
> > >
> > > Caused by commit 03f582a93ecca6e9584b622570022abf08ed03ec ("misc: Add
> > > ab8500 pwm driver").  I have reverted that commit for today.
> > >
> Please find the patch that fixes this build issue @ 
> http://git.kernel.org/?p=linux/kernel/git/sameo/mfd-2.6.git;a=commit;h=f33bd494862cdc519db1f5d9b3f8214a1dd4c1ff

That patch was in the tree that produced the error above.  The patch you
quote is a fix for a different build problem.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* RE: linux-next: build failure after merge of the final tree (mfd tree related)
  2010-09-14  3:43 Stephen Rothwell
  2010-09-14  5:05 ` Arun MURTHY
@ 2010-09-16  7:15 ` Arun MURTHY
  2010-09-16  7:23   ` Stephen Rothwell
  1 sibling, 1 reply; 24+ messages in thread
From: Arun MURTHY @ 2010-09-16  7:15 UTC (permalink / raw)
  To: Stephen Rothwell, Samuel Ortiz
  Cc: linux-next, linux-kernel, Linus WALLEIJ, Mattias WALLIN,
	Srinidhi KASAGAR, Arun MURTHY

Hi Stephen,

> > Hi Samuel,
> >
> > After merging the final tree, today's linux-next build (powerpc
> > allyesconfig) failed like this:
> >
> > drivers/mfd/built-in.o: In function `__crc_pwm_free':
> > (*ABS*+0x24ba6d1e): multiple definition of `__crc_pwm_free'
> > drivers/mfd/built-in.o: In function `.pwm_free':
> > (.text+0x1ab3c): multiple definition of `.pwm_free'
> > drivers/misc/built-in.o:(.text+0x2620c): first defined here
> > drivers/mfd/built-in.o: In function `__crc_pwm_request':
> > (*ABS*+0xc1f4ec93): multiple definition of `__crc_pwm_request'
> > drivers/mfd/built-in.o: In function `__crc_pwm_enable':
> > (*ABS*+0x9d09808d): multiple definition of `__crc_pwm_enable'
> > drivers/mfd/built-in.o: In function `.pwm_enable':
> > (.text+0x1abc8): multiple definition of `.pwm_enable'
> > drivers/misc/built-in.o:(.text+0x26278): first defined here
> > drivers/mfd/built-in.o: In function `.pwm_request':
> > (.text+0x1a774): multiple definition of `.pwm_request'
> > drivers/misc/built-in.o:(.text+0x2604c): first defined here
> > drivers/mfd/built-in.o: In function `pwm_config':
> > (.opd+0x1ce0): multiple definition of `pwm_config'
> > drivers/misc/built-in.o:(.opd+0x3000): first defined here
> > drivers/mfd/built-in.o: In function `pwm_free':
> > (.opd+0x1d28): multiple definition of `pwm_free'
> > drivers/misc/built-in.o:(.opd+0x2fd0): first defined here
> > drivers/mfd/built-in.o: In function `pwm_request':
> > (.opd+0x1cf8): multiple definition of `pwm_request'
> > drivers/misc/built-in.o:(.opd+0x2f58): first defined here
> > drivers/mfd/built-in.o: In function `__crc_pwm_disable':
> > (*ABS*+0xb0493b18): multiple definition of `__crc_pwm_disable'
> > drivers/mfd/built-in.o: In function `.pwm_disable':
> > (.text+0x1aa24): multiple definition of `.pwm_disable'
> > drivers/misc/built-in.o:(.text+0x2613c): first defined here
> > drivers/mfd/built-in.o: In function `pwm_enable':
> > (.opd+0x1d40): multiple definition of `pwm_enable'
> > drivers/misc/built-in.o:(.opd+0x2fe8): first defined here
> > drivers/mfd/built-in.o: In function `.pwm_config':
> > (.text+0x1a648): multiple definition of `.pwm_config'
> > drivers/misc/built-in.o:(.text+0x26358): first defined here
> > drivers/mfd/built-in.o: In function `pwm_disable':
> > (.opd+0x1d10): multiple definition of `pwm_disable'
> > drivers/misc/built-in.o:(.opd+0x2fb8): first defined here
> > drivers/mfd/built-in.o: In function `__crc_pwm_config':
> > (*ABS*+0xc23f5b9): multiple definition of `__crc_pwm_config'
> >
> > Caused by commit 03f582a93ecca6e9584b622570022abf08ed03ec ("misc: Add
> > ab8500 pwm driver").  I have reverted that commit for today.
> >
Please find the patch that fixes this build issue @ 
http://git.kernel.org/?p=linux/kernel/git/sameo/mfd-2.6.git;a=commit;h=f33bd494862cdc519db1f5d9b3f8214a1dd4c1ff

Kindly merge this patch.

Thanks and Regards,
Arun R Murthy
------------

^ permalink raw reply	[flat|nested] 24+ messages in thread

* RE: linux-next: build failure after merge of the final tree (mfd tree related)
  2010-09-14  3:43 Stephen Rothwell
@ 2010-09-14  5:05 ` Arun MURTHY
  2010-09-16  7:15 ` Arun MURTHY
  1 sibling, 0 replies; 24+ messages in thread
From: Arun MURTHY @ 2010-09-14  5:05 UTC (permalink / raw)
  To: Stephen Rothwell, Samuel Ortiz
  Cc: linux-next, linux-kernel, Linus WALLEIJ, Mattias WALLIN,
	Srinidhi KASAGAR

Hi Stephen/Samuel,
	The following patch fixes the build issue.

Thanks and Regards,
Arun R Murthy
-------------
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index fbfe14a..841ce47 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -475,7 +475,7 @@ config EZX_PCAP

 config AB8500_CORE
        bool "ST-Ericsson AB8500 Mixed Signal Power Management chip"
-       depends on GENERIC_HARDIRQS && ABX500_CORE
+       depends on GENERIC_HARDIRQS && ABX500_CORE && ARCH_U8500
        select MFD_CORE
        help
          Select this option to enable access to AB8500 power management
------------

> -----Original Message-----
> From: Stephen Rothwell [mailto:sfr@canb.auug.org.au]
> Sent: Tuesday, September 14, 2010 9:13 AM
> To: Samuel Ortiz
> Cc: linux-next@vger.kernel.org; linux-kernel@vger.kernel.org; Arun
> MURTHY
> Subject: linux-next: build failure after merge of the final tree (mfd
> tree related)
> 
> Hi Samuel,
> 
> After merging the final tree, today's linux-next build (powerpc
> allyesconfig) failed like this:
> 
> drivers/mfd/built-in.o: In function `__crc_pwm_free':
> (*ABS*+0x24ba6d1e): multiple definition of `__crc_pwm_free'
> drivers/mfd/built-in.o: In function `.pwm_free':
> (.text+0x1ab3c): multiple definition of `.pwm_free'
> drivers/misc/built-in.o:(.text+0x2620c): first defined here
> drivers/mfd/built-in.o: In function `__crc_pwm_request':
> (*ABS*+0xc1f4ec93): multiple definition of `__crc_pwm_request'
> drivers/mfd/built-in.o: In function `__crc_pwm_enable':
> (*ABS*+0x9d09808d): multiple definition of `__crc_pwm_enable'
> drivers/mfd/built-in.o: In function `.pwm_enable':
> (.text+0x1abc8): multiple definition of `.pwm_enable'
> drivers/misc/built-in.o:(.text+0x26278): first defined here
> drivers/mfd/built-in.o: In function `.pwm_request':
> (.text+0x1a774): multiple definition of `.pwm_request'
> drivers/misc/built-in.o:(.text+0x2604c): first defined here
> drivers/mfd/built-in.o: In function `pwm_config':
> (.opd+0x1ce0): multiple definition of `pwm_config'
> drivers/misc/built-in.o:(.opd+0x3000): first defined here
> drivers/mfd/built-in.o: In function `pwm_free':
> (.opd+0x1d28): multiple definition of `pwm_free'
> drivers/misc/built-in.o:(.opd+0x2fd0): first defined here
> drivers/mfd/built-in.o: In function `pwm_request':
> (.opd+0x1cf8): multiple definition of `pwm_request'
> drivers/misc/built-in.o:(.opd+0x2f58): first defined here
> drivers/mfd/built-in.o: In function `__crc_pwm_disable':
> (*ABS*+0xb0493b18): multiple definition of `__crc_pwm_disable'
> drivers/mfd/built-in.o: In function `.pwm_disable':
> (.text+0x1aa24): multiple definition of `.pwm_disable'
> drivers/misc/built-in.o:(.text+0x2613c): first defined here
> drivers/mfd/built-in.o: In function `pwm_enable':
> (.opd+0x1d40): multiple definition of `pwm_enable'
> drivers/misc/built-in.o:(.opd+0x2fe8): first defined here
> drivers/mfd/built-in.o: In function `.pwm_config':
> (.text+0x1a648): multiple definition of `.pwm_config'
> drivers/misc/built-in.o:(.text+0x26358): first defined here
> drivers/mfd/built-in.o: In function `pwm_disable':
> (.opd+0x1d10): multiple definition of `pwm_disable'
> drivers/misc/built-in.o:(.opd+0x2fb8): first defined here
> drivers/mfd/built-in.o: In function `__crc_pwm_config':
> (*ABS*+0xc23f5b9): multiple definition of `__crc_pwm_config'
> 
> Caused by commit 03f582a93ecca6e9584b622570022abf08ed03ec ("misc: Add
> ab8500 pwm driver").  I have reverted that commit for today.
> 
> --
> Cheers,
> Stephen Rothwell                    sfr@canb.auug.org.au
> http://www.canb.auug.org.au/~sfr/

^ permalink raw reply	[flat|nested] 24+ messages in thread

* linux-next: build failure after merge of the final tree (mfd tree related)
@ 2010-09-14  3:43 Stephen Rothwell
  2010-09-14  5:05 ` Arun MURTHY
  2010-09-16  7:15 ` Arun MURTHY
  0 siblings, 2 replies; 24+ messages in thread
From: Stephen Rothwell @ 2010-09-14  3:43 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-next, linux-kernel, Arun Murthy

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

Hi Samuel,

After merging the final tree, today's linux-next build (powerpc
allyesconfig) failed like this:

drivers/mfd/built-in.o: In function `__crc_pwm_free':
(*ABS*+0x24ba6d1e): multiple definition of `__crc_pwm_free'
drivers/mfd/built-in.o: In function `.pwm_free':
(.text+0x1ab3c): multiple definition of `.pwm_free'
drivers/misc/built-in.o:(.text+0x2620c): first defined here
drivers/mfd/built-in.o: In function `__crc_pwm_request':
(*ABS*+0xc1f4ec93): multiple definition of `__crc_pwm_request'
drivers/mfd/built-in.o: In function `__crc_pwm_enable':
(*ABS*+0x9d09808d): multiple definition of `__crc_pwm_enable'
drivers/mfd/built-in.o: In function `.pwm_enable':
(.text+0x1abc8): multiple definition of `.pwm_enable'
drivers/misc/built-in.o:(.text+0x26278): first defined here
drivers/mfd/built-in.o: In function `.pwm_request':
(.text+0x1a774): multiple definition of `.pwm_request'
drivers/misc/built-in.o:(.text+0x2604c): first defined here
drivers/mfd/built-in.o: In function `pwm_config':
(.opd+0x1ce0): multiple definition of `pwm_config'
drivers/misc/built-in.o:(.opd+0x3000): first defined here
drivers/mfd/built-in.o: In function `pwm_free':
(.opd+0x1d28): multiple definition of `pwm_free'
drivers/misc/built-in.o:(.opd+0x2fd0): first defined here
drivers/mfd/built-in.o: In function `pwm_request':
(.opd+0x1cf8): multiple definition of `pwm_request'
drivers/misc/built-in.o:(.opd+0x2f58): first defined here
drivers/mfd/built-in.o: In function `__crc_pwm_disable':
(*ABS*+0xb0493b18): multiple definition of `__crc_pwm_disable'
drivers/mfd/built-in.o: In function `.pwm_disable':
(.text+0x1aa24): multiple definition of `.pwm_disable'
drivers/misc/built-in.o:(.text+0x2613c): first defined here
drivers/mfd/built-in.o: In function `pwm_enable':
(.opd+0x1d40): multiple definition of `pwm_enable'
drivers/misc/built-in.o:(.opd+0x2fe8): first defined here
drivers/mfd/built-in.o: In function `.pwm_config':
(.text+0x1a648): multiple definition of `.pwm_config'
drivers/misc/built-in.o:(.text+0x26358): first defined here
drivers/mfd/built-in.o: In function `pwm_disable':
(.opd+0x1d10): multiple definition of `pwm_disable'
drivers/misc/built-in.o:(.opd+0x2fb8): first defined here
drivers/mfd/built-in.o: In function `__crc_pwm_config':
(*ABS*+0xc23f5b9): multiple definition of `__crc_pwm_config'

Caused by commit 03f582a93ecca6e9584b622570022abf08ed03ec ("misc: Add
ab8500 pwm driver").  I have reverted that commit for today.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2013-06-20  2:25 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-21  2:59 linux-next: build failure after merge of the final tree (mfd tree related) Stephen Rothwell
2011-03-21  8:08 ` [PATCH v7] MAX8997/8966 MFD: Add IRQ control feature MyungJoo Ham
2011-03-22 11:51   ` Samuel Ortiz
2011-03-24  6:54     ` [PATCH] " MyungJoo Ham
  -- strict thread matches above, loose matches on Subject: below --
2013-06-18  7:19 linux-next: build failure after merge of the final tree (mfd tree related) Stephen Rothwell
2013-06-19  8:24 ` Samuel Ortiz
2013-06-20  2:25   ` Chao Xie
2012-09-17 11:38 Stephen Rothwell
2012-09-17 13:28 ` Samuel Ortiz
2011-12-21  6:33 Stephen Rothwell
2011-12-21 10:51 ` Cousson, Benoit
2011-12-21 12:24   ` Samuel Ortiz
2011-12-22 17:30 ` Samuel Ortiz
2011-03-28  3:52 Stephen Rothwell
2011-03-21  8:12 함명주
2010-12-20  8:21 Stephen Rothwell
2010-12-20 10:33 ` Samuel Ortiz
2010-12-20 10:52   ` Mark Brown
2010-12-20 12:18     ` Mark Brown
2010-09-14  3:43 Stephen Rothwell
2010-09-14  5:05 ` Arun MURTHY
2010-09-16  7:15 ` Arun MURTHY
2010-09-16  7:23   ` Stephen Rothwell
2010-09-16  8:51     ` Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).