From patchwork Thu Jul 12 09:57:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 1188091 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id BCDEEE0038 for ; Thu, 12 Jul 2012 10:05:13 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SpGC3-0007B7-Er; Thu, 12 Jul 2012 10:00:19 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SpGAD-000713-8U for linux-arm-kernel@lists.infradead.org; Thu, 12 Jul 2012 09:58:29 +0000 Received: from dude.hi.pengutronix.de ([2001:6f8:1178:2:21e:67ff:fe11:9c5c]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1SpG9o-0008VV-2H; Thu, 12 Jul 2012 11:58:00 +0200 Received: from ukl by dude.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1SpG9n-00016D-7V; Thu, 12 Jul 2012 11:57:59 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Samuel Ortiz Subject: [PATCH 7/7] mfd/mc13xxx: add support for mc34708 Date: Thu, 12 Jul 2012 11:57:53 +0200 Message-Id: <1342087073-3892-8-git-send-email-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1342087073-3892-1-git-send-email-u.kleine-koenig@pengutronix.de> References: <1342087073-3892-1-git-send-email-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:6f8:1178:2:21e:67ff:fe11:9c5c X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: "Ying-Chun Liu \(PaulLiu\)" , Mark Brown , linux-kernel@vger.kernel.org, kernel@pengutronix.de, =?UTF-8?q?Philippe=20R=C3=A9tornaz?= , Marc Reilly , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Signed-off-by: Uwe Kleine-König --- drivers/mfd/mc13xxx-core.c | 21 +++++++++++++++++++++ drivers/mfd/mc13xxx-i2c.c | 6 ++++++ drivers/mfd/mc13xxx-spi.c | 4 ++++ drivers/mfd/mc13xxx.h | 3 ++- 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c index 7874711..4ce3e1f 100644 --- a/drivers/mfd/mc13xxx-core.c +++ b/drivers/mfd/mc13xxx-core.c @@ -119,6 +119,11 @@ #define MC13XXX_REVISION_FAB (0x03 << 11) #define MC13XXX_REVISION_ICIDCODE (0x3f << 13) +#define MC34708_REVISION_REVMETAL (0x07 << 0) +#define MC34708_REVISION_REVFULL (0x07 << 3) +#define MC34708_REVISION_FIN (0x07 << 6) +#define MC34708_REVISION_FAB (0x07 << 9) + #define MC13XXX_ADC1 44 #define MC13XXX_ADC1_ADEN (1 << 0) #define MC13XXX_ADC1_RAND (1 << 1) @@ -424,6 +429,16 @@ static void mc13xxx_print_revision(struct mc13xxx *mc13xxx, u32 revision) maskval(revision, MC13XXX_REVISION_ICIDCODE)); } +static void mc34708_print_revision(struct mc13xxx *mc13xxx, u32 revision) +{ + dev_info(mc13xxx->dev, "%s: rev %d.%d, fin: %d, fab: %d\n", + mc13xxx->variant->name, + maskval(revision, MC34708_REVISION_REVFULL), + maskval(revision, MC34708_REVISION_REVMETAL), + maskval(revision, MC34708_REVISION_FIN), + maskval(revision, MC34708_REVISION_FAB)); +} + /* These are only exported for mc13xxx-i2c and mc13xxx-spi */ struct mc13xxx_variant mc13xxx_variant_mc13783 = { .name = "mc13783", @@ -437,6 +452,12 @@ struct mc13xxx_variant mc13xxx_variant_mc13892 = { }; EXPORT_SYMBOL_GPL(mc13xxx_variant_mc13892); +struct mc13xxx_variant mc13xxx_variant_mc34708 = { + .name = "mc34708", + .print_revision = mc34708_print_revision, +}; +EXPORT_SYMBOL_GPL(mc13xxx_variant_mc34708); + static const char *mc13xxx_get_chipname(struct mc13xxx *mc13xxx) { return mc13xxx->variant->name; diff --git a/drivers/mfd/mc13xxx-i2c.c b/drivers/mfd/mc13xxx-i2c.c index 6c1598c..907abff 100644 --- a/drivers/mfd/mc13xxx-i2c.c +++ b/drivers/mfd/mc13xxx-i2c.c @@ -26,6 +26,9 @@ static const struct i2c_device_id mc13xxx_i2c_device_id[] = { .name = "mc13892", .driver_data = (kernel_ulong_t)&mc13xxx_variant_mc13892, }, { + .name = "mc34708", + .driver_data = (kernel_ulong_t)&mc13xxx_variant_mc34708, + }, { /* sentinel */ } }; @@ -36,6 +39,9 @@ static const struct of_device_id mc13xxx_dt_ids[] = { .compatible = "fsl,mc13892", .data = &mc13xxx_variant_mc13892, }, { + .compatible = "fsl,mc34708", + .data = &mc13xxx_variant_mc34708, + }, { /* sentinel */ } }; diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c index 75a00c4..08a3bd9 100644 --- a/drivers/mfd/mc13xxx-spi.c +++ b/drivers/mfd/mc13xxx-spi.c @@ -33,6 +33,9 @@ static const struct spi_device_id mc13xxx_device_id[] = { .name = "mc13892", .driver_data = (kernel_ulong_t)&mc13xxx_variant_mc13892, }, { + .name = "mc34708", + .driver_data = (kernel_ulong_t)&mc13xxx_variant_mc34708, + }, { /* sentinel */ } }; @@ -41,6 +44,7 @@ MODULE_DEVICE_TABLE(spi, mc13xxx_device_id); static const struct of_device_id mc13xxx_dt_ids[] = { { .compatible = "fsl,mc13783", .data = &mc13xxx_variant_mc13783, }, { .compatible = "fsl,mc13892", .data = &mc13xxx_variant_mc13892, }, + { .compatible = "fsl,mc34708", .data = &mc13xxx_variant_mc34708, }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, mc13xxx_dt_ids); diff --git a/drivers/mfd/mc13xxx.h b/drivers/mfd/mc13xxx.h index 78bf4c3..460ec5c 100644 --- a/drivers/mfd/mc13xxx.h +++ b/drivers/mfd/mc13xxx.h @@ -24,7 +24,8 @@ struct mc13xxx_variant { extern struct mc13xxx_variant mc13xxx_variant_mc13783, - mc13xxx_variant_mc13892; + mc13xxx_variant_mc13892, + mc13xxx_variant_mc34708; struct mc13xxx { struct regmap *regmap;