From patchwork Fri May 29 22:19:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Hiremath X-Patchwork-Id: 49245 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8D1D324588 for ; Fri, 29 May 2015 22:23:01 +0000 (UTC) Received: by wgv5 with SMTP id 5sf17209285wgv.0 for ; Fri, 29 May 2015 15:23:00 -0700 (PDT) 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=/hHcPw44KwrdO3f+POEZT126vmUo/Q1PIpV2kPMNB+c=; b=NH3kFEk9Dij7O8Az3El8ClKbWrIwiWlIDINdmsC6Op7svjbsqP1RfN5Ov4zXAAKkkF Dh6kvIH0pHh/d6IVck4L3tXgbEs80NPMH8qZ9K36asg1Crt9nU6r/qjUd2M59J2fJAhn Ir0A70iWTLSbXea0mE1tla3X+Gvmpd83pBbKwDXZ48Am1du5Yz3qHt5mYXP5gAD9HVOW ueDGE7LRe9LTW8XbNHqM8zybQcUE3QtdMlDpk6EZkhzNcKbwwARTsBSAlVUWSCoa9922 y5Q/l8Shjq1s3/ZnuIJz+KRp9q8Crf+6otW+cs51iUTnkKqRVP4lA/8OG3TRfSNo+Idj KjwA== X-Gm-Message-State: ALoCoQlMStlrCoO1rC2+Kl/d+cXMOlGzE9Y7DRtwLTxi75WwEOCO+c9sbCh2d8fHQqg1EZ+3cskJ X-Received: by 10.112.162.228 with SMTP id yd4mr9028441lbb.8.1432938180850; Fri, 29 May 2015 15:23:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.228 with SMTP id z4ls320855lal.90.gmail; Fri, 29 May 2015 15:23:00 -0700 (PDT) X-Received: by 10.152.44.132 with SMTP id e4mr10384757lam.34.1432938180701; Fri, 29 May 2015 15:23:00 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id pl9si5789098lbb.111.2015.05.29.15.23.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 May 2015 15:23:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbbuc2 with SMTP id uc2so56924184lbb.2 for ; Fri, 29 May 2015 15:23:00 -0700 (PDT) X-Received: by 10.112.234.200 with SMTP id ug8mr10000316lbc.117.1432938180599; Fri, 29 May 2015 15:23:00 -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.112.108.230 with SMTP id hn6csp667358lbb; Fri, 29 May 2015 15:22:59 -0700 (PDT) X-Received: by 10.68.65.43 with SMTP id u11mr18518207pbs.41.1432938178683; Fri, 29 May 2015 15:22:58 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id re12si10318402pdb.36.2015.05.29.15.22.57; Fri, 29 May 2015 15:22:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 S1757507AbbE2WWv (ORCPT + 7 others); Fri, 29 May 2015 18:22:51 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:33193 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757454AbbE2WWD (ORCPT ); Fri, 29 May 2015 18:22:03 -0400 Received: by padj3 with SMTP id j3so2203762pad.0 for ; Fri, 29 May 2015 15:22:02 -0700 (PDT) X-Received: by 10.66.165.67 with SMTP id yw3mr18631602pab.95.1432938122894; Fri, 29 May 2015 15:22:02 -0700 (PDT) Received: from localhost.localdomain ([202.62.77.106]) by mx.google.com with ESMTPSA id nb10sm6605761pdb.76.2015.05.29.15.21.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 May 2015 15:22:01 -0700 (PDT) From: Vaibhav Hiremath To: linux-arm-kernel@lists.infradead.org Cc: robh+dt@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com, sameo@linux.intel.com, lee.jones@linaro.org, a.zummo@towertech.it, alexandre.belloni@free-electrons.com, Vaibhav Hiremath , Chao Xie Subject: [PATCH 4/4] mfd: 88pm800: allocate pdata->rtc if not allocated earlier Date: Sat, 30 May 2015 03:49:22 +0530 Message-Id: <1432937962-4537-5-git-send-email-vaibhav.hiremath@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432937962-4537-1-git-send-email-vaibhav.hiremath@linaro.org> References: <1432937962-4537-1-git-send-email-vaibhav.hiremath@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: vaibhav.hiremath@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) 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: , RTC in pmic 88PM800 can run even the core is powered off, and user can set alarm in RTC. When the alarm is timed out, the PMIC will power up the core, and the whole system will boot up. And during PMIC driver probe, it will read some register to find out whether this boot is caused by RTC timeout or not, and pass on this information to the RTC driver. So we need rtc platform data to be existed in PMIC driver to pass this information. Signed-off-by: Chao Xie Signed-off-by: Vaibhav Hiremath --- drivers/mfd/88pm800.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/mfd/88pm800.c b/drivers/mfd/88pm800.c index 8ea4467..34546a1 100644 --- a/drivers/mfd/88pm800.c +++ b/drivers/mfd/88pm800.c @@ -586,6 +586,25 @@ static int pm800_probe(struct i2c_client *client, return ret; } + /* + * RTC in pmic can run even the core is powered off, and user can set + * alarm in RTC. When the alarm is time out, the PMIC will power up + * the core, and the whole system will boot up. When PMIC driver is + * probed, it will read out some register to find out whether this + * boot is caused by RTC timeout or not, and it need pass this + * information to RTC driver. + * So we need rtc platform data to be existed to pass this information. + */ + if (!pdata->rtc) { + pdata->rtc = devm_kzalloc(&client->dev, + sizeof(*(pdata->rtc)), GFP_KERNEL); + if (!pdata->rtc) { + dev_err(&client->dev, + "failed to allocate memory for rtc\n"); + return -ENOMEM; + } + } + ret = pm80x_init(client); if (ret) { dev_err(&client->dev, "pm800_init fail\n");