From patchwork Fri Jul 10 15:50:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 11656925 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D3806C1 for ; Fri, 10 Jul 2020 15:51:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5538620720 for ; Fri, 10 Jul 2020 15:51:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="W65ei7B5"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="YH+/OWFe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5538620720 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=oBIXL+Z7cg3wrB02IBjHwhse650/pjZ6XQ+r/O0PPY4=; b=W65ei7B5L1w0um+QHt0IRoHUU jl0zG5kBk8if2Vv6qIq+GCxaTRmK/yFnQBfjx4lsiQ4RTitxFHAsKvcssiN+N7tQOdewGG88Czwx7 SwDe0TZdXb1rhH0ziwmWqBrhTk+ViiudkXDRet+3xS7DKacmPlbhb9aDlm8Pd73nOvx3BP+yLJuPz 5tZUmK0oSoPaxSnxVUH58SFIOfeWW07a/o88Tl1muLmbCDcbAOTtVAapXc50O3bcbog9j3jAKiTfY PEwmJRizKaHMzU6ROyIAo6nc8CIcP905zK9YmZcBFWU4yoG7vGbbaC4/aUbtlfkxevfxILDQLyYh7 pue0mhDPQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtvJR-0004mF-Bk; Fri, 10 Jul 2020 15:51:45 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtvJP-0004kj-RJ for linux-rockchip@lists.infradead.org; Fri, 10 Jul 2020 15:51:44 +0000 Received: by mail-pf1-x442.google.com with SMTP id u185so2721318pfu.1 for ; Fri, 10 Jul 2020 08:51:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=omCpbeqcJPh1o1xXQNItUN/WxYdikkBt0s5WkGVn3zA=; b=YH+/OWFei9o2nGWHjMUyUXsWpn7/6c2xj57+lUhWv9of3Lb5cCbwng1K7QSpeTaFQT fCjPLHYiGUsq7bbPEz+booiNX3oWvGMuahV/waxHLbNi9ZQLYTxnXc6YPPMpEwRi056d oykXKehTDpKBO2l5SVHLD5JCLPkiykqO24bp4= 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:mime-version:content-transfer-encoding; bh=omCpbeqcJPh1o1xXQNItUN/WxYdikkBt0s5WkGVn3zA=; b=mNDXsxq1Pe4aQBH941NdVfGFXPdNFgpJfBTbmaoX9/6YVK2XHIiKU0/nOiEfCEAYW5 Moh99T9GBT7ZNRqsomfFlL/MlMcJnBgMcdLpt97ugD7Rc9pRyPg22fF8SW3qdSN1ZXni iX1E9AXDA0zGuFQSXqkVaGUX8eMA39+2PGyMb5uorNm+TjaNOufq+2Kw1azwngucO07Q k8T6pOB8hjmta+TYt8zRd6L64AbgXB1AwlAn1t+JxXqAFnmJON1ckE8nu8wAc9gzmf4J QxLyawwMvIxpdjFFJXfohIUxTC59inPANd79f8xgdFNMeTXHT37Pf13KvVlP3/5T7+rU 7vww== X-Gm-Message-State: AOAM531rasUzrVJwozK2RG0K6qJ3FsLpTqONwhkfX/6rP/Wg2N10G9e6 Se3fb434lufE2CgLg4cAdXCN9Q== X-Google-Smtp-Source: ABdhPJyal76azwT55234MPOdNuDzkPe8SUnjem3+J682WfrOcQE0Xpc/0IDlcYVbI07Tf/A45oGh9A== X-Received: by 2002:aa7:9909:: with SMTP id z9mr57248971pff.139.1594396301649; Fri, 10 Jul 2020 08:51:41 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:a1d6:54e3:577a:ace0]) by smtp.gmail.com with ESMTPSA id lx2sm6398917pjb.16.2020.07.10.08.51.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 08:51:40 -0700 (PDT) From: Jagan Teki To: Kever Yang , Philipp Tomsich , Simon Glass Subject: [PATCH v4 2/4] power: pmic: rk8xx: bind rk808 RTC Date: Fri, 10 Jul 2020 21:20:55 +0530 Message-Id: <20200710155057.310168-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200710155057.310168-1-jagan@amarulasolutions.com> References: <20200710155057.310168-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200710_115143_903246_8D40EA6B X-CRM114-Status: GOOD ( 11.88 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: U-Boot-Denx , linux-rockchip@lists.infradead.org, linux-amarula , Suniel Mahesh Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org From: Suniel Mahesh RK808 PMIC is a multi functional device with an RTC. In order to access RTC, bind to its parent device i.e. RK808 PMIC. Signed-off-by: Suniel Mahesh Reviewed-by: Kever Yang --- Change for v4: - none drivers/power/pmic/rk8xx.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/power/pmic/rk8xx.c b/drivers/power/pmic/rk8xx.c index 195884bde9..aea9272f8a 100644 --- a/drivers/power/pmic/rk8xx.c +++ b/drivers/power/pmic/rk8xx.c @@ -25,6 +25,11 @@ static const struct pmic_child_info pmic_children_info[] = { { }, }; +static const struct pmic_child_info rtc_info[] = { + { .prefix = "rk808-rtc", .driver = "rk808_rtc"}, + { }, +}; + static int rk8xx_reg_count(struct udevice *dev) { return RK808_NUM_OF_REGS; @@ -60,7 +65,7 @@ static int rk8xx_read(struct udevice *dev, uint reg, uint8_t *buff, int len) #if CONFIG_IS_ENABLED(PMIC_CHILDREN) static int rk8xx_bind(struct udevice *dev) { - ofnode regulators_node; + ofnode regulators_node, rtc_node; int children; regulators_node = dev_read_subnode(dev, "regulators"); @@ -76,6 +81,18 @@ static int rk8xx_bind(struct udevice *dev) if (!children) debug("%s: %s - no child found\n", __func__, dev->name); + rtc_node = dev_read_subnode(dev, "rtc"); + if (!ofnode_valid(rtc_node)) { + debug("%s: %s rtc subnode not found!\n", __func__, dev->name); + return -ENXIO; + } + + debug("%s: '%s' - found rtc subnode\n", __func__, dev->name); + + children = pmic_bind_children(dev, rtc_node, rtc_info); + if (!children) + debug("%s: %s - no child found\n", __func__, dev->name); + /* Always return success for this device */ return 0; }