Received: by 2002:a05:6358:520b:b0:123:56d3:7acd with SMTP id b11csp21944rwa; Sat, 13 May 2023 10:17:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6kPhKrDKzSf9x6NDYEIaq1m7So8DNjEtvOXGSe/O7jInxFtleRjv2mx9EGp9G70OqstQZU X-Received: by 2002:a17:903:22cb:b0:1ac:6e1f:d19c with SMTP id y11-20020a17090322cb00b001ac6e1fd19cmr28072562plg.41.1683998222280; Sat, 13 May 2023 10:17:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683998222; cv=none; d=google.com; s=arc-20160816; b=jlPmq7835On20Wl7tYGTd+XndcbeYT9r96E1E9dEH3ydFmt7m+mJSo5Amr1Yi3pVdJ hf3DehItI+CWdqBY0IiGW4m0k7LB+BuLUXnamSGMGtWf5ttHpF24wjk7yU1sVx/fr/lg sia8xvV2h4g9oV8pVmajoIunGU6OCg+rlk5hSYTaBPVETJmZQdazyCEHTharAsCCY9xW 21y/qC2Ults/eku6SJHZd/Dqth8fxqEIzLct+j5qwk/OgaA9A8rU8GSl3Q7+HYaTOe0N 9dj12BilP2ObHUTyucmG7iI0HHcXsFk8ngV2r0yG7qPixkYygkSlBbavsHqfoP3/w3qr nOxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=pr0TUjT9Aq/hDhKs3Gj5T8vrXyimVBa+nxBZbxMGM0M=; b=klOR2/OCXYWrjVXr6d2MxDfF/itaeTkwVKi2U2FvCtVIjGtZYN48PCEKF/WT+oZ46L nlsPnhO9AviQ5A42Jo1QCrJFehJ5W1KJXOT2YFGKP6G5vY96VCfQ1Y0wtNo5QAeDHpBZ Ks0tYNUTJt+TITluRIWQq2l38iHTyv5j4eXvHTr6wxYFI2FIco3ytNUu8mztrFokhDHh AcqTGxE/Br4SKi8OF/nMuoWMIVsQkoHHD44oQ6CPqTfYSE4//Hfx4dpiW1gspCrOJzKO WmbM/snZz0tM+++hf6naI+54O2mWGoLivCpvX8Hc8yZ0U8vcOsn6gsEwwIfXJjdBLpXn pScw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id be6-20020a170902aa0600b001a1f3916f4bsi10868749plb.265.2023.05.13.10.16.37; Sat, 13 May 2023 10:17:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230061AbjEMQwj (ORCPT + 99 others); Sat, 13 May 2023 12:52:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229603AbjEMQwi (ORCPT ); Sat, 13 May 2023 12:52:38 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 593D830C4; Sat, 13 May 2023 09:52:36 -0700 (PDT) X-IronPort-AV: E=Sophos;i="5.99,272,1677510000"; d="scan'208";a="159221916" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 14 May 2023 01:52:35 +0900 Received: from localhost.localdomain (unknown [10.226.92.8]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 3291340062D0; Sun, 14 May 2023 01:52:30 +0900 (JST) From: Biju Das To: Lee Jones , Wolfram Sang , Alessandro Zummo , Alexandre Belloni , Rob Herring , Krzysztof Kozlowski Cc: Biju Das , Geert Uytterhoeven , Magnus Damm , devicetree@vger.kernel.org, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Fabrizio Castro Subject: [PATCH v3 0/5] Add Renesas PMIC RAA215300 and built-in RTC support Date: Sat, 13 May 2023 17:52:22 +0100 Message-Id: <20230513165227.13117-1-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=1.1 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series aims to add support for Renesas PMIC RAA215300 and built-in RTC found on this PMIC device. The details of PMIC can be found here[1]. Renesas PMIC RAA215300 exposes two separate i2c devices, one for the main device and another for rtc device. Enhance i2c_new_ancillary_device() to instantiate a real device. (eg: Instantiate rtc device from PMIC driver) The built-in RTC found on PMIC RAA215300 is the same as ISL1208. However, the external oscillator bit is inverted on PMIC version 0x11. The PMIC driver detects PMIC version and instantiate appropriate RTC device. [1] https://www.renesas.com/in/en/products/power-power-management/multi-channel-power-management-ics-pmics/ssdsoc-power-management-ics-pmic-and-pmus/raa215300-high-performance-9-channel-pmic-supporting-ddr-memory-built-charger-and-rtc [2] https://patchwork.kernel.org/project/linux-renesas-soc/patch/20230505091720.115675-1-biju.das.jz@bp.renesas.com/ [3] https://patchwork.kernel.org/project/linux-renesas-soc/patch/20230505172530.357455-5-biju.das.jz@bp.renesas.com/ v2->v3: * Enhanced i2c_new_ancillary_device() to instantiate a real ancillary_device(). * RTC device is instantiated by PMIC driver and dropped isl1208_probe_helper(). * Added "TYPE_RAA215300_RTC_A0" to handle inverted oscillator bit case. * Added more detailed description for renesas,rtc-enabled property. * Added support for handling "renesas,rtc-enabled" property. * Based on PMIC version, it instantiates rtc device by calling i2c_new_ ancillary_device(). * Updated the logs. RFC->v2: * Dropped the cross-links from bindings and used a single compatible with separate i2c addresses for pmic main and rtc device. * Dropped patch#4 and split patch#3 from this series and send as separate patch to ML [2]. * Added RTC platform driver and mfd cell entry to the PMIC driver.RTC platform driver creates rtc device by using i2c_new_ancillary_device() and register the rtc device by calling the helper function provided by rtc-isl2108 driver. * Updated reg property in bindings. * Added optional reg-names, interrupts and renesas,rtc-enabled properties. * Fixed the node name in the binding example * Dropped the cross link property renesas,raa215300-rtc. * Updated the binding example * Dropped MODULE_SOFTDEP from the driver as it is added in RTC platform driver. * Dropped compatible "renesas,raa215300-isl1208" and "renesas,raa215300-pmic" property. * Updated the comment polarity->bit for External Oscillator. * Added raa215300_rtc_probe_helper() for registering raa215300_rtc device and added the helper function isl1208_probe_helper() to share the code. * Updated pmic device node on the SoM dtsi based on the bindings. Logs: [ 15.447305] rtc-isl1208 3-006f: registered as rtc0 [ 15.479493] rtc-isl1208 3-006f: setting system clock to 2023-04-27T19:31:02 UTC (1682623862) root@smarc-rzv2l:~# hwclock -r 2023-04-27 19:33:05.499001+00:00 root@smarc-rzv2l:~# hwclock -r 2023-04-27 19:33:06.936688+00:00 root@smarc-rzv2l:~# Biju Das (5): i2c: Enhance i2c_new_ancillary_device API rtc: isl1208: Add support for the built-in RTC on the PMIC RAA215300 dt-bindings: mfd: Add Renesas RAA215300 PMIC bindings mfd: Add Renesas PMIC RAA215300 driver arm64: dts: renesas: rzg2l-smarc-som: Enable PMIC and built-in RTC .../bindings/mfd/renesas,raa215300.yaml | 70 ++++++++++++ .../boot/dts/renesas/rzg2l-smarc-som.dtsi | 10 ++ drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 6 +- drivers/i2c/i2c-core-base.c | 38 +++++-- drivers/media/i2c/adv748x/adv748x-core.c | 2 +- drivers/media/i2c/adv7604.c | 3 +- drivers/mfd/Kconfig | 7 ++ drivers/mfd/Makefile | 2 + drivers/mfd/raa215300.c | 102 ++++++++++++++++++ drivers/rtc/rtc-isl1208.c | 21 ++++ include/linux/i2c.h | 3 +- 11 files changed, 251 insertions(+), 13 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/renesas,raa215300.yaml create mode 100644 drivers/mfd/raa215300.c -- 2.25.1