From patchwork Tue Feb 11 17:52:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Moll X-Patchwork-Id: 24488 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f199.google.com (mail-yk0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5616D203F3 for ; Tue, 11 Feb 2014 17:53:04 +0000 (UTC) Received: by mail-yk0-f199.google.com with SMTP id 10sf23806583ykt.2 for ; Tue, 11 Feb 2014 09:53:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=SfW9MnxJunIsmI7IMQp5QhsuSCcGkKlE4zYOh1jA2pI=; b=SwyccWoXOv8zhXQS2E0BUIdM1PDbvwtImtojkzBJ8cqy+nhZuM1Rrn8vl+mzJNTnhg rp3PXC1FAKi6GWAGVJCY4zuwOkNn98Ibk5bciowlZnfV26CLQE0+IwpPAjn7Kef8qC7r yXcawbK6mOO+vv5NOtwEu3+LoOz7iWIVODXO08cU5M+kSY3p7/Q8MoUOH0y+DD+o1S35 TKIWbavNNZr2ENY6E+D33NCv6pShBwI1tDefawbQMnVBhlTR6ww9q5EjHUBc3noH5Nx3 Q/WJy5nkp8TkGHw5PrxUaXklFO8sfW6F7AAE99beA+NBruOzAeuCG3TglnHubYhrXIsd NRew== X-Gm-Message-State: ALoCoQkQ1j48RQxggsloBkI+04xGWbck951tGhSR6UpTZchZRyobLuR1ausYptQa20XbIGsm+/lm X-Received: by 10.224.55.19 with SMTP id s19mr295115qag.0.1392141183473; Tue, 11 Feb 2014 09:53:03 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.32.116 with SMTP id g107ls2723702qgg.49.gmail; Tue, 11 Feb 2014 09:53:03 -0800 (PST) X-Received: by 10.58.90.202 with SMTP id by10mr28201404veb.6.1392141183400; Tue, 11 Feb 2014 09:53:03 -0800 (PST) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id wm4si6188104vcb.79.2014.02.11.09.53.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Feb 2014 09:53:03 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id la4so6164057vcb.35 for ; Tue, 11 Feb 2014 09:53:03 -0800 (PST) X-Received: by 10.58.207.13 with SMTP id ls13mr29879437vec.13.1392141183302; Tue, 11 Feb 2014 09:53:03 -0800 (PST) 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.174.196 with SMTP id u4csp265102vcz; Tue, 11 Feb 2014 09:53:02 -0800 (PST) X-Received: by 10.69.31.65 with SMTP id kk1mr46375184pbd.47.1392141182071; Tue, 11 Feb 2014 09:53:02 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3si19760711pbh.40.2014.02.11.09.52.59; Tue, 11 Feb 2014 09:52:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752153AbaBKRwu (ORCPT + 27 others); Tue, 11 Feb 2014 12:52:50 -0500 Received: from fw-tnat.austin.arm.com ([217.140.110.23]:55941 "EHLO collaborate-mta1.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751614AbaBKRws (ORCPT ); Tue, 11 Feb 2014 12:52:48 -0500 Received: from hornet.Cambridge.Arm.com (hornet.cambridge.arm.com [10.2.201.45]) by collaborate-mta1.arm.com (Postfix) with ESMTP id 011C513F841; Tue, 11 Feb 2014 11:52:46 -0600 (CST) From: Pawel Moll To: Lee Jones , Samuel Ortiz Cc: arm@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Pawel Moll Subject: [PATCH v2 1/2] mfd: syscon: Add platform data with a regmap config name Date: Tue, 11 Feb 2014 17:52:44 +0000 Message-Id: <1392141165-14338-1-git-send-email-pawel.moll@arm.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <20140211174829.GJ15081@lee--X1> References: <20140211174829.GJ15081@lee--X1> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.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: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- 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 71841f9..854b8d9 100644 --- a/drivers/mfd/syscon.c +++ b/drivers/mfd/syscon.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -126,6 +127,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; @@ -143,6 +145,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..921e59a --- /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