From patchwork Thu Apr 26 02:58:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 134400 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1668886lji; Wed, 25 Apr 2018 19:59:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+4VjOQxO6/coJD37eIOnaIIMMRtoM7wWKIQo186C+/VCzrharP8mVs6mHUU5lTgF6XBtXQ X-Received: by 10.98.59.203 with SMTP id w72mr22843367pfj.129.1524711588583; Wed, 25 Apr 2018 19:59:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524711588; cv=none; d=google.com; s=arc-20160816; b=czDqq7hurgCTae8yFaSkhW5QkkeTLuNXT1U5YPqiN3JK8aU8uAdT+XbrgCy1oOVzn2 s4SpbST86VElnOYYAPmnSGfQ1mXhbJxXjg4Vyobof3WnSV6rAihYIi7X9K0t7P22G0nI eIUC1i465FOJUHuQgcVdoSltWOK8wBq2XozjH8l1ZO/xprx1FIgxtuKPYTZd9K7GzCFf Ytv+QMBp6HxRuk2dZDzhw/iTMPCOcblHoGE2s5VntZeRRT/yBnXwBmjXpyJnyMeyDmc1 GLPE8EbVkuQ1P47F/3MgWHerVRN+CKUtD7nfWL9TjLHQhJDqvQXia3G6Ml6I/L5lR0Wq M50w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=oqO1yo7anAQMVVPjIzFxniYWg3ofUmwQOOFB8NPAeBI=; b=MbL60uw3V3OFnSa7T4WeFE4cqAclkEvIj42O5Z5gPUL0vuC+kFde5qF8CtaX7Ks4Ue +YIz+B2k/Z/44GyD681eUKXTAc4J6WpIcO3gKe9Ef5FqyBSq14Xot/dUoEahBiZJDBGD H5NgpBpNIF7qG9q4l5o8M+s37HZGVrDqaWMYVvdANUXhtpgvZQU6541JFh07DJBlG3Lo YGsaHt8QqmO18pm1ubRR4YKPcA4Y1zc25KqXDsUWpx4BWFUYUA3DS2Ff/8mUXySQRy46 pChbV8tWfjDTkbtFLE9MHgMheBy6usVjZeLQCfkRo+ETAag/fNU/J35aLQrUzfaHSAOa TSlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=au1huh6H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d18si15184669pgo.310.2018.04.25.19.59.48; Wed, 25 Apr 2018 19:59:48 -0700 (PDT) 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; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=au1huh6H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752051AbeDZC7n (ORCPT + 29 others); Wed, 25 Apr 2018 22:59:43 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36076 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751424AbeDZC7l (ORCPT ); Wed, 25 Apr 2018 22:59:41 -0400 Received: by mail-pf0-f193.google.com with SMTP id g14so16982933pfh.3 for ; Wed, 25 Apr 2018 19:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=oqO1yo7anAQMVVPjIzFxniYWg3ofUmwQOOFB8NPAeBI=; b=au1huh6HlJ1DjefAeq597t1+7eHK+urTdZlH8VzgMdiKqu/CTVMvQvXjiJWkH333Mp oNbh9lGvDpqywua6tYYmWctVvjqQHMtT9yl+FQnUMBHd3IJSPn/oTmTmvNkm53dl9D8/ 4UAVGcKT5t6E2XhCmhg2VzHdUN56I2tm6f8CQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=oqO1yo7anAQMVVPjIzFxniYWg3ofUmwQOOFB8NPAeBI=; b=Ubi2txlveNXAA/lzhgWcUYldqRW8qg8eZGnyYeL17yxdKun7Td9AA3bXGqFGh2jThJ XwAJ7UZdTrDhaw3DKAF9L9acWN6X5o+Nzkx7FhN1tIt3+iZCkxfh2JMj9YCjQlD/+Gx2 lSqpAn+keRfpv3U9ILd3ntt+gZDNIZKMpGEwZX+uNqTh7mhwhnCBwpVcp5cCjlLzbnA7 rbJCvY7j/2XSdZ+sA8S2vI8/vbs9z57Slztr/6zNe3AXrNjsfvTjzhXXW0RYSvgV0DKg cClAga2ycEJx3VqhfyEIT8sxgN7BxzaO8AtCM/VQ6466B/xOo5xNZH4EXZLjnJHSnReh QfWQ== X-Gm-Message-State: ALQs6tDQiYVqx3TuTXmxQYyrVfNKNrAeM+dZWh4+hHiRsomQTL0Ke++5 AmMwfg/CIOxEcKVPOxo0gWZmgA== X-Received: by 2002:a17:902:5844:: with SMTP id f4-v6mr1430950plj.35.1524711581032; Wed, 25 Apr 2018 19:59:41 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id a81sm43852557pfc.168.2018.04.25.19.59.38 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Apr 2018 19:59:40 -0700 (PDT) From: Baolin Wang To: a.zummo@towertech.it, alexandre.belloni@bootlin.com Cc: baolin.wang@linaro.org, broonie@kernel.org, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] rtc: sprd: Change to use devm_rtc_allocate_device() Date: Thu, 26 Apr 2018 10:58:44 +0800 Message-Id: <95b85b6d0369b4693e9d4e57af5eac49eee87dc9.1524710929.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a preparation patch, changing to use devm_rtc_allocate_device() that can allow driver to set 'range_max' and 'range_min' for the RTC device. Signed-off-by: Baolin Wang --- drivers/rtc/rtc-sc27xx.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) -- 1.7.9.5 diff --git a/drivers/rtc/rtc-sc27xx.c b/drivers/rtc/rtc-sc27xx.c index 00d87d1..ac86322 100644 --- a/drivers/rtc/rtc-sc27xx.c +++ b/drivers/rtc/rtc-sc27xx.c @@ -600,6 +600,10 @@ static int sprd_rtc_probe(struct platform_device *pdev) return rtc->irq; } + rtc->rtc = devm_rtc_allocate_device(&pdev->dev); + if (IS_ERR(rtc->rtc)) + return PTR_ERR(rtc->rtc); + rtc->dev = &pdev->dev; platform_set_drvdata(pdev, rtc); @@ -626,10 +630,12 @@ static int sprd_rtc_probe(struct platform_device *pdev) return ret; } - rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, - &sprd_rtc_ops, THIS_MODULE); - if (IS_ERR(rtc->rtc)) - return PTR_ERR(rtc->rtc); + rtc->rtc->ops = &sprd_rtc_ops; + ret = rtc_register_device(rtc->rtc); + if (ret) { + dev_err(&pdev->dev, "failed to register rtc device\n"); + return ret; + } device_init_wakeup(&pdev->dev, 1); return 0; From patchwork Thu Apr 26 02:58:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 134401 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1668962lji; Wed, 25 Apr 2018 19:59:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqX/Rg4fazNWGygPWh+vrb2xCoF8QXt2LcfuKkGf9YN6OqJDFx7PhvNBazlA/12L5fwdpfG X-Received: by 2002:a17:902:bc08:: with SMTP id n8-v6mr8199550pls.97.1524711594253; Wed, 25 Apr 2018 19:59:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524711594; cv=none; d=google.com; s=arc-20160816; b=HOFg4sOmsPNRB2mz9DkvlzS0HY/rhEKp+R9iHIm6U2aHlvt4jnBlCazZilCQoACKov F+VOpd8OzYtszDn/zLFnLB8lFb8NmF2HNWsQGgQ2bOav8PVrnf+pE6ji0wfZHPdD0xD/ mbHx4oQ2/V8WWcCkLoLyg7RPuNiN64r5/xUQQF9rvVnebCT3M+jBn6BeSK42WyIIdzPB qnKY5tUTvRcX7c9KtAYG9X4vavJEZqU+fqr5z/iLSwFNXsJI0REz6WD+LDb+Ln1yvE01 LTyKjBGrtDsD+EkNqpkfcpR8VQQc/bGxZh0o9kTKDv56Hg5iUSocnw7D9MB9i3qwRt+i YOZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=693JLNzjyMzYeX/5z/e8s2tElsrNNa7tak6qVknr5DE=; b=ffiVf9oPGFtD9TybwYX0NOPK2F6YI73yvau2lZqVB6AHYYYXgYFr+Q/wxRJmEggXAD b1zg3YrcKfJXBdMP+aBCMv7dDifwfWkh2rs/7jtNqQ6ClalQ+njxRVhmNBHEetyLgH9g gWqZihqNlQCk4hJsZLXOkVR3iPK6fAFKbkT1O74Q9DmGmJojNjNC2QZQ1zLMtuT0dTE5 BnOhPlZ4fckbPL91d9MvuxPLizSTF16w5xcsBfrZ8vdpOoLT/aY2AVxiqIxzu1faqgFI /ObQB37Z/m9XKKfbjbVzUfLlIu43d8RrgrpgeipiCBLqoiQCVP8R5S4yorRARZ+VUqzm 8xlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k3+1EL5R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si4183033pgv.593.2018.04.25.19.59.53; Wed, 25 Apr 2018 19:59:54 -0700 (PDT) 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; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k3+1EL5R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752630AbeDZC7u (ORCPT + 29 others); Wed, 25 Apr 2018 22:59:50 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35001 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752129AbeDZC7o (ORCPT ); Wed, 25 Apr 2018 22:59:44 -0400 Received: by mail-pg0-f68.google.com with SMTP id j11so14776350pgf.2 for ; Wed, 25 Apr 2018 19:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=693JLNzjyMzYeX/5z/e8s2tElsrNNa7tak6qVknr5DE=; b=k3+1EL5R1D9I5UJ9iEu/3VhqrS2F/uqZ/BBtl4XY7eRbVacyClQucxx/4IFKyIlzdG 2Y4KA744+B0WCdpD2hgSQ1+UnHC0L9Y3QH4F2M6hqXQM3YO3RXtKN1u+V4xJiDDUW+FW SFcrEe3dKcDAKDE8t8NZqLJeZ9fzTaM1Udm5g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=693JLNzjyMzYeX/5z/e8s2tElsrNNa7tak6qVknr5DE=; b=mtX/39SHybCxay7vgaBK/+Magu/HanlBD6hMdc10xtEcwWnwOz0uldaf5B0HBop8MY Fuk8Ny1IVbouaZQHpbQySeHSVgTpxndhL6J9C40t3Jtzz+aI8KudGakx1fGc/UbLX4+W TKrUtxegZUryEkYXa+PpNAZjNE1sWCJiz0ycY1EWDgMBEwTtTBBaCNbObWq9R4eYLk71 FhJ8AMDR/5HJadVq0HTxm9lPJk1nTs2vUnxKcTppU1ufD5mxQ3CWSVphj2eBXf7nvyna Rpfju6HewezZKT+9IDOrn8RfrFEqNTgsGuYMqYni5fLrPpGDEGuG/VD+lmZmRAyJhzJt MPaQ== X-Gm-Message-State: ALQs6tBEyfmhaSsT40K1TvBneVQ7R4v+zZHAW3uXyFiUvjbTsKwBKFrQ xO08oEGeRgb5VcQV3MaI5HCeLg+sDBk= X-Received: by 2002:a17:902:7146:: with SMTP id u6-v6mr1271647plm.289.1524711583435; Wed, 25 Apr 2018 19:59:43 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id a81sm43852557pfc.168.2018.04.25.19.59.41 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Apr 2018 19:59:43 -0700 (PDT) From: Baolin Wang To: a.zummo@towertech.it, alexandre.belloni@bootlin.com Cc: baolin.wang@linaro.org, broonie@kernel.org, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] rtc: sprd: Add RTC hardware range Date: Thu, 26 Apr 2018 10:58:45 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <95b85b6d0369b4693e9d4e57af5eac49eee87dc9.1524710929.git.baolin.wang@linaro.org> References: <95b85b6d0369b4693e9d4e57af5eac49eee87dc9.1524710929.git.baolin.wang@linaro.org> In-Reply-To: <95b85b6d0369b4693e9d4e57af5eac49eee87dc9.1524710929.git.baolin.wang@linaro.org> References: <95b85b6d0369b4693e9d4e57af5eac49eee87dc9.1524710929.git.baolin.wang@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The SC27xx RTC can support dates from 1970-01-01 00:00:00 to 2149-06-06 23:59:59. Signed-off-by: Baolin Wang --- drivers/rtc/rtc-sc27xx.c | 2 ++ 1 file changed, 2 insertions(+) -- 1.7.9.5 diff --git a/drivers/rtc/rtc-sc27xx.c b/drivers/rtc/rtc-sc27xx.c index ac86322..6a3876e 100644 --- a/drivers/rtc/rtc-sc27xx.c +++ b/drivers/rtc/rtc-sc27xx.c @@ -631,6 +631,8 @@ static int sprd_rtc_probe(struct platform_device *pdev) } rtc->rtc->ops = &sprd_rtc_ops; + rtc->rtc->range_min = 0; + rtc->rtc->range_max = 5662310399LL; ret = rtc_register_device(rtc->rtc); if (ret) { dev_err(&pdev->dev, "failed to register rtc device\n");