From patchwork Mon Apr 28 17:57:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Moll X-Patchwork-Id: 29260 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f70.google.com (mail-pb0-f70.google.com [209.85.160.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 348F420553 for ; Mon, 28 Apr 2014 17:59:55 +0000 (UTC) Received: by mail-pb0-f70.google.com with SMTP id jt11sf19608420pbb.1 for ; Mon, 28 Apr 2014 10:59:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=Gi3/GS0cXkrbsfCAteZwzlyOym5MFfo/vqWaoDlTVEM=; b=GFLURAP5cAD9AfMHmTyyn9r6//JTFB6TnaxdMYAvnZC6h5BhxXXjn/iWutAd9a+mSM yRafqXOfGkw5jX0ESKrqNNKui179uEAwuFyw1KAVCe3XhkosbfzIr+EBSlURx2CWLsCu /2fFxE9Z2Aa046HI1u5sD70LF+1sJyJdik+pXNX8gLaK01iTI16r/Z6lL9Wftk/lCb3f eDMhA7Z25HLCVsVheIZF0Fwilgp1Rnli8lDUdDmZqYYzlRvOzTS01ARP9jNvMwAgQd+E Dr3i6MK5VdIk9TC6rHc6W+0BnN4Gh+lDZWnQVmzZ0yq05aZvwBUSI5BgSLPp2CTcMqBa sbMA== X-Gm-Message-State: ALoCoQk4McPprEoNo0c6wcTLa2PZm1545esTxCqGtp4UUNK+sawWBz34Z5wmpxTMjfOY4idVEwQd X-Received: by 10.67.4.202 with SMTP id cg10mr11939708pad.42.1398707994454; Mon, 28 Apr 2014 10:59:54 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.108.72 with SMTP id i66ls2802904qgf.78.gmail; Mon, 28 Apr 2014 10:59:54 -0700 (PDT) X-Received: by 10.52.229.97 with SMTP id sp1mr21241492vdc.23.1398707994270; Mon, 28 Apr 2014 10:59:54 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id ys15si3823102vcb.70.2014.04.28.10.59.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Apr 2014 10:59:54 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id db11so8291917veb.21 for ; Mon, 28 Apr 2014 10:59:54 -0700 (PDT) X-Received: by 10.58.13.104 with SMTP id g8mr24617050vec.16.1398707994123; Mon, 28 Apr 2014 10:59:54 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp136027vcb; Mon, 28 Apr 2014 10:59:53 -0700 (PDT) X-Received: by 10.224.35.209 with SMTP id q17mr35675968qad.9.1398707993222; Mon, 28 Apr 2014 10:59:53 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id s101si8285982qge.46.2014.04.28.10.59.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Apr 2014 10:59:53 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wepp9-00039y-ST; Mon, 28 Apr 2014 17:58:39 +0000 Received: from fw-tnat.austin.arm.com ([217.140.110.23] helo=collaborate-mta1.arm.com) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wepox-0002zE-BG for linux-arm-kernel@lists.infradead.org; Mon, 28 Apr 2014 17:58:28 +0000 Received: from hornet.Cambridge.Arm.com (hornet.cambridge.arm.com [10.2.201.45]) by collaborate-mta1.arm.com (Postfix) with ESMTP id 333D713FE8C; Mon, 28 Apr 2014 12:58:04 -0500 (CDT) From: Pawel Moll To: Grant Likely , Rob Herring , Samuel Ortiz , Lee Jones , Arnd Bergmann , Greg Kroah-Hartman , Russell King Subject: [PATCH 03/10] mfd: syscon: Add platform data with a regmap config name Date: Mon, 28 Apr 2014 18:57:50 +0100 Message-Id: <1398707877-22596-4-git-send-email-pawel.moll@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1398707877-22596-1-git-send-email-pawel.moll@arm.com> References: <1398707877-22596-1-git-send-email-pawel.moll@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140428_105827_439521_418A4487 X-CRM114-Status: GOOD ( 11.74 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record Cc: arm@kernel.org, Pawel Moll , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pawel.moll@arm.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Define syscon platform data structure that can be used to define a regmap config name. This is particularly useful in the regmap debugfs when there is more than one syscon device registered, to distinguish the register blocks. Signed-off-by: Pawel Moll Acked-by: Lee Jones --- drivers/mfd/syscon.c | 4 ++++ include/linux/platform_data/syscon.h | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100644 include/linux/platform_data/syscon.h diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c index dbea55d..e2a04bb 100644 --- a/drivers/mfd/syscon.c +++ b/drivers/mfd/syscon.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -119,6 +120,7 @@ static struct regmap_config syscon_regmap_config = { static int syscon_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; + struct syscon_platform_data *pdata = dev_get_platdata(dev); struct syscon *syscon; struct resource *res; void __iomem *base; @@ -136,6 +138,8 @@ static int syscon_probe(struct platform_device *pdev) return -ENOMEM; syscon_regmap_config.max_register = res->end - res->start - 3; + if (pdata) + syscon_regmap_config.name = pdata->label; syscon->regmap = devm_regmap_init_mmio(dev, base, &syscon_regmap_config); if (IS_ERR(syscon->regmap)) { diff --git a/include/linux/platform_data/syscon.h b/include/linux/platform_data/syscon.h new file mode 100644 index 0000000..2354c6f --- /dev/null +++ b/include/linux/platform_data/syscon.h @@ -0,0 +1,8 @@ +#ifndef PLATFORM_DATA_SYSCON_H +#define PLATFORM_DATA_SYSCON_H + +struct syscon_platform_data { + const char *label; +}; + +#endif