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: 1480 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4573E3F06D for ; Fri, 10 Jul 2020 17:51:44 +0200 (CEST) Received: by mail-pj1-f70.google.com with SMTP id a6sf4238706pjd.4 for ; Fri, 10 Jul 2020 08:51:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1594396302; cv=pass; d=google.com; s=arc-20160816; b=TWWzyAvbucr9dBmxRmT/0NmzAXUhNtoU6t4HKv7MBBs1wuhs3KJLVycfSOJ3wnKyMY jb/RstlNvSfptmjrDPuVUUVesiwS0wkrITS4ng+ZWjrxIMM/2Lp+Z9fGwWmCSCIleio+ FvDXbmNxZFTK4lgOCims4TWAJdZg3OoglIOh6BNgEVS+errRp9U5oTDvb4uzxZJD8AaQ aQaC5igYZJgk8zq3wm09Fh0ZHKSMTqWmK617D6QBSnwIWg6qs2vjsSwr5hppOai7WCUt zNmsvOFblhBT4SNMTha9dAyREs7I8xwJefWto9798pK6p8wHBe2j5deXD3UQq0B7zBX/ qQYA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Eyj/Gt2VbQwROXHM9wBbe3OkTwpE6B9ciMdgU02YgUE=; b=mcYayv8K8mDLMpnMBNrR3rVIyKrsFdemQQC7yGc3oR8u9GjgseWlZ0RbUogqWb3osr KaKmrGOZpD1zpb0gcHmoSoOKol0k/goGQnZeAaFb+f+xQeUCdVP7h6/BFAvhgfhXcQXE fXvW3agGv/N7i6OyjdWKnqmyLDlwBVoJKO/IpyUHlLjCQLavbeavZEbWQCCLiws05Naw VzriJIfvvOPD6ZyxxnGpsj2t8GB38vjIud525r0iRjWnlIBO2mxQ480iwIC5X2y+kVnC E34VSs5UXPl5w6yCcaK02CpT/tJ59kXlJAzrfEcX+i1CukuvXT2DkcZc3qA6kOfNrJJN /CLw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="YH+/OWFe"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=Eyj/Gt2VbQwROXHM9wBbe3OkTwpE6B9ciMdgU02YgUE=; b=OfKIdNec5eCEp9i6Kxw76wDsK1h7zYPPKmilp25Cc54Z7Icp8xWO9ZCAOl+4YxLTPV D185ZM5twnmlHKjctg3yAX5+cY2l2Z4WzKBUZDxlhwt8hcGjMB04dOAm+eAvbyNbmQ8D 0q7DuQXGJPO9r2wy4P6vLbSMjPedjgRcXXpvo= 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=Eyj/Gt2VbQwROXHM9wBbe3OkTwpE6B9ciMdgU02YgUE=; b=A422rQMNIffyqdparHBTooJDPJws4SDkhM5VnFIz7g50fgnWgkteuD8K1m7TAe3zw+ prfgYA89F4jKk6P9wba8ds4T34UQogi4yUgASRo+FWl+z9QYDi2cyXvWacjAfeh/qwMh Dh7qnfV6zMKZ1Y/UT/gd2/6gPe1QCOsRnHjPgBy/6Ut2guhPFaakXdLUkstJdcQofqpj iZOuBUvBQ1ozsZHntyHiQtQ6EP5rcTF2+w11jONOVcM1oC/ju/5wiFZ+vSzL+FCoU+El VSVyreBNkFGLlKmoyGAm9DhUPL2rJNWKnAc/CW/egGhgAZtb5NsL0uU3s+VSCMAdeKPX nS5g== X-Gm-Message-State: AOAM531v6kf6Rtlxo54/iS3to2AhcA1bLM8Z47dO7PJnx7GNxSneVMCu PmJBw50lkJ+GysIGHVIF87Qo7UHe X-Google-Smtp-Source: ABdhPJzx12JhP4MiMEdVWgEruzTUNR0svduGqTDwwi3xUYVLo5e7KE333SLrOLpMY0tEtrgirQxpNw== X-Received: by 2002:a17:902:b694:: with SMTP id c20mr59799304pls.123.1594396302439; Fri, 10 Jul 2020 08:51:42 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:86c3:: with SMTP id y3ls4364276pjv.0.gmail; Fri, 10 Jul 2020 08:51:42 -0700 (PDT) X-Received: by 2002:a17:90a:780f:: with SMTP id w15mr6307730pjk.235.1594396301950; Fri, 10 Jul 2020 08:51:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594396301; cv=none; d=google.com; s=arc-20160816; b=Fh3z0D7jE8CajhoIlOmlHSMY8/+C6z4fmZDDgtxg++zNO11VUHXdCk5oz3CKd5BDlj /com5Vhdbg2AZxxTQRhZ1AZvdLQmgsPQs3B7xOB9YX+g1KPMV1KLFxFIdv3GqoWgztdT 2v7VJntq+R/Jse6QaZ2GFEQfjTVOhq8y9s+uRvjuIpbYsZrwTnRnBJqMF6RCMh8VRZXp plBLIhIUx2K2gLSM+zbR7WdcInNGIHO/9vahzI8Wz+aIYyhB+NUoliv5dbplehb9UL7W NjXMhpakfE9kAjl95f7MWBviHKMti+TwTmnebhGC6n2JNy2LkFFVyTEUlOwrqqyj7gMc oyZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=omCpbeqcJPh1o1xXQNItUN/WxYdikkBt0s5WkGVn3zA=; b=oSn7WQLtsd08cw8Dv3F5faP8Fd3YbugBNXzMPrhzGD9usTGDG+y8Jh1Wk0xWi4wS9i 58VMtkm0KB2pF2r9YFfOiXwOExTJI3m7hnc5t0ea4wsNOGumpiieuAWViPN1CFXYl+E/ U/QH0dKYsahYKfqqqoSLjLuBkOv5pHbIgv/LqoKlv5cSSUq7ltHmwxgrMepqUl8pNu+V 0V+IxP1E5FLTWqM4wK+FJu1ZwAcTQZUaUIoDFkncRaePu0ClFcWSahH3OiUaFh7QZYWL JpsNo1mFvqatwUBlilVD5ObKILPd/bBglk+bsjwbgkSOOumccTK622MDQAa+T0YuVcbK 3FQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="YH+/OWFe"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id c7sor7951067pfc.12.2020.07.10.08.51.41 for (Google Transport Security); Fri, 10 Jul 2020 08:51:41 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; 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 Cc: Suniel Mahesh , U-Boot-Denx , linux-rockchip@lists.infradead.org, linux-amarula 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-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="YH+/OWFe"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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; }