From nobody Thu Apr 2 17:16:00 2026 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5760A352F89 for ; Wed, 11 Feb 2026 18:50:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.68 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770835804; cv=none; b=RprPMTP3QbVDA7TVJjSDNGIfz9pxHLjLMYjfrGT7NpT0h0tsH2NfxqMvnSGUOStLR8EZJHyKBI1ZvtPL4SoehPbcAp9FLGfR02nDLHHoF+kof1lyiM0+AO4xkaFQwGedwEuRPPNFtMUooJWbLkjh9gbt31PjYCMw3p+2yjRhT3k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770835804; c=relaxed/simple; bh=hZat0I9VIdWWHDsvicQ3Z9KpzrhEFn0VJe8SEXYtBso=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Cz85LREJuhtcfcID5avDCgZb3ZG37JWjGSlc3RvJiQ/bo6j0DVCF7OJbCC/0fEgK3OLtQsqu2DFAXoGfdGMBDjrVxHEkl1re5tZx+BTcVR+8M0ZsjPVdGpwcIkdcHjiaK/5Xgfu7EwPCKfusbU+wqZ2VCfgrRNVA/RJVUXdRDZE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dnu/UZXU; arc=none smtp.client-ip=209.85.128.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dnu/UZXU" Received: by mail-wm1-f68.google.com with SMTP id 5b1f17b1804b1-47ee3a63300so27622005e9.2 for ; Wed, 11 Feb 2026 10:50:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770835802; x=1771440602; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bwu2nMaud2Bbjzz+z2shZFKs0C47ZRHqGTyVHyxnk5Q=; b=dnu/UZXUWPC6TQCnhVhBYrON9WhRL4ZIOmqicXoFn9G2qjh0MjAkxU6Xh60XC9/LRb 6uktgDEQ5zTuO1XttEbnegixhKIDtACJ60BobD5pjsk4R8+G9cELo/e210mW0HJbAqnq IlYsyf5TquwAb8FilaMFMKRfaFpAT+ynUGexraslNd3Wz58bmWghlPkJXfC1A2yJnlWt zMAiF61zbdGa31eWcKYUIvhyN5mYNGm5R9Ll3eZv8EsCp1+UNHXuij7ZjGnOufQOwMIt 4mdkuus1L1vnpaxhOtRsHAVz/sMCJJo53PEEF35sUBACO4Jg8eckIexC1+vnUzl55Dpr A3eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770835802; x=1771440602; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=bwu2nMaud2Bbjzz+z2shZFKs0C47ZRHqGTyVHyxnk5Q=; b=kZW5qKV2Ug2ms3nuhciUy2PIFM2NaVOm0lP83UUm6UFI9R/Z1XFimG8CbqsJwQcpW9 mJspeqxR5zLlTKfVnc+tLVyHKb27EThFgjD5omMrVOhax53etvs9VNQcsU5jitpXxT6r dnZaZVb+8u3Q7cIUlDaQ8T2bS7dEdk4YkLVZrTRuZ8jiCoVaID8lvFw0SUrdI3ZPmkD8 CYDtGdtrCdfIkYRhuvG8xQouFRvY+hkjfMM5bvwNTinkZFfS4Huz0wxmQ5SLiwn8PkyN h4Qw1Fzk2mgP10BbakVCPYqI9HOJ6X4gIOpYuCOfRQO/L7fIl919GCgRGJWlf2kBGPKD 7IcQ== X-Gm-Message-State: AOJu0YyNli5N1+UGza6yES1GfCTDqrNcjZ1y/sbKkn0HhfpeRDoPTMGA SVsMoMRbchGr94Sl3zl/6Ujy1YB6CLljtsRQ58lDCZ9mnfUChky+rvEz X-Gm-Gg: AZuq6aLxLUG0ltZggey9/XGK2TqjaNsBt3Uyj2zhjwD/JGmAubibK0dIM1O24sbgnld egb/0Khs3jhzZYMg+n/MwHcfBu0oFXdR/dsCeMudUY7Crb6OLeRMZp2GrqVbNifnI8T2z0ZKNYq UsBxZuc2AjPesKrHLaGXqCmGTh7o6AUVY6gH21xCIlw1maP5E6AFaLOitt2DeAPm6iDQSJ03cT7 TzPBpSoGRSxsygWgJLgzpU0gAlaIy54NxKfv8NjRQS7+E/9MxVHPZsO7TfPY/8ArQ2Y+zCle/wm rZpAZSBqA6Zul+RBYNDVq1sep84VHtLo1f5T9wvNodF1wn+/eU21/tFnx9ABnfARl0dSDug5LK9 rTmsEa974Yp44Qo1edfTGMu1+sRXM0A7qL0qCG5DxjLFUmoo02E+HG4yTrpXEkiFhLEN+87cUat W2IJO3Oq8FDwXW X-Received: by 2002:a05:600c:4e93:b0:480:699c:abe9 with SMTP id 5b1f17b1804b1-48365822c6emr1965835e9.37.1770835801734; Wed, 11 Feb 2026 10:50:01 -0800 (PST) Received: from xeon ([188.163.112.48]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835d99497asm93175855e9.6.2026.02.11.10.50.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Feb 2026 10:50:01 -0800 (PST) From: Svyatoslav Ryhel To: Chanwoo Choi , Krzysztof Kozlowski , Lee Jones , Rob Herring , Conor Dooley , Alexandre Belloni Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-rtc@vger.kernel.org Subject: [PATCH v1 1/2] dt-bindings: mfd: maxim,max77686: document optional RTC address Date: Wed, 11 Feb 2026 20:49:40 +0200 Message-ID: <20260211184941.6756-2-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260211184941.6756-1-clamor95@gmail.com> References: <20260211184941.6756-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Document an optional second I2C address for the PMIC's RTC device, to be used if the RTC is located at a non-default I2C address Signed-off-by: Svyatoslav Ryhel --- .../devicetree/bindings/mfd/maxim,max77686.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/mfd/maxim,max77686.yaml b/Do= cumentation/devicetree/bindings/mfd/maxim,max77686.yaml index c13d51e462ba..2d4aad8feaeb 100644 --- a/Documentation/devicetree/bindings/mfd/maxim,max77686.yaml +++ b/Documentation/devicetree/bindings/mfd/maxim,max77686.yaml @@ -32,7 +32,17 @@ properties: maxItems: 1 =20 reg: - maxItems: 1 + description: + Can contain an optional second I2C address pointing to the PMIC's + RTC device. If no RTC address is provided, a default address specific + to this PMIC will be used. + minItems: 1 + maxItems: 2 + + reg-names: + items: + - const: pmic + - const: rtc =20 voltage-regulators: $ref: /schemas/regulator/maxim,max77686.yaml @@ -59,7 +69,8 @@ examples: =20 max77686: pmic@9 { compatible =3D "maxim,max77686"; - reg =3D <0x09>; + reg =3D <0x09>, <0x06>; + reg-names =3D "pmic", "rtc"; =20 interrupt-parent =3D <&gpx0>; interrupts =3D <7 IRQ_TYPE_LEVEL_LOW>; --=20 2.51.0 From nobody Thu Apr 2 17:16:00 2026 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42A4F288C2F for ; Wed, 11 Feb 2026 18:50:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770835805; cv=none; b=E8qCeOMEuKpBZRb1aD6IBya+QaASgMFDYYC2/2a0Dl4kiSCBN/ExDu2GVTPWdIeQsMYkOhhxXJZpNjVYTuB1SBqZUXeekwOf9bhIQ5+V92urnCovEkezXLaquEHBiYy22uKoJP9/eARFzDHpuujhEL5vgUQ2cCrNtePq+H2FzcM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770835805; c=relaxed/simple; bh=OCqMqTV3Fk0GHlGjVJ0UFzNI1DHV1XFUgzJgSRR9AZA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J8mjqcmVZNnxR1CFS3usZ6HgH0eH/Xa91mT1AS2JSVtCrJ+5Bun2Tcqa4wAgjooPqKgSPNC+BdPA3z3NFFvW2YdAEkE9JUqsfU7OycsFRoCPPVAeMQqDWkctWOrjXkSF0JEui4Qmp3uKHyLnuMeH+2lwp7WZrozq5Nsb3TLtn4c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Z0uuZgsi; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Z0uuZgsi" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4806ce0f97bso20615825e9.0 for ; Wed, 11 Feb 2026 10:50:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770835803; x=1771440603; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+87770G0UGJrf+jBGNAZwy7BjuGZ53X0m5gpUF71N68=; b=Z0uuZgsiO0lWjTfML7tP2pVKbRNZAS5fx+tesPWj7cYnm9JP0eOXq52j7IrWibv65w c7JzebPje1YUmgV0c7zbiLt+TDP7uUHwwUI4tEtS2csG8SEGsmE6rdq7cRwOtIo+cRP0 s7nsBkvt5hroFyVUaHDqRTJryFzPho9X7G8tN5B/OkhUIRO55MsYESJ9ilh1VPegOQJ1 UHfJV1swyoo+bIiCniccCYSJO5+8eB4zQ8DPWUzDID3KQki5F6c7I/vumE5VtjanW+68 UQ3u9tcLEnFoCmnT6RflUWAze86xVe4v7565GFOloHk+sDsVt613PaTA61tfjSo+lQGo AFhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770835803; x=1771440603; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=+87770G0UGJrf+jBGNAZwy7BjuGZ53X0m5gpUF71N68=; b=SJCGm7ElTRPjae95wyAlFTN52MUZ2nzDLsQ9HCu9k6yJm/DC2sH2S9UvGtcydbJuHh OYrOZfYFwhFJ0O0eBAEFCVY2tgrlZwlwAMnnqQd18lwI0jmN5JEka1NoC8K94UuuDIka Bh1Yst18Ub8Xhd3wQjsWFkqSkC1Qv3wAfwO/KKzWIFfJsK5DyQ6CiXmzRcGF6BGeVZ8I nH7iYJSeIcCNqvql1Hr7zzdNwVjSYKZfSNmgZez3dPaUASgYdH8DJTqQdHoIhVzEET5X N7oM7m4bmoEJGVXRKu02vkagouTTwqXpRjWmU5baa21Y2lsRW5uPPWFg9xZwKDPsRNDj zIDw== X-Gm-Message-State: AOJu0Yzfk00KqynhEDFLqJo5ldyGK2KxDk0cUtAnJE6iO4pLDHYKLHEJ +uj3AWCvddy21sl5hweKbxzHGxZqQ/sCj3ihKlTLApN3sU1/gM8URP8NjJVRmw== X-Gm-Gg: AZuq6aK0Pe+aNW21GrXGYhinkvtuMwzwOP/48RANHsaWk72krUbo1W5I1G65+s/luPG 2BUlZhss/ahdNq8zg6lAxhldzJg8psK6A6MOkB4FI3n+tlx9yVgE+jqDYexVi7MKRuvHyQ0HJwy SpDzisa0PyjJb9d118jwm1ibBUgyfCmNz2xzHWJqIK7WgRkyXKwV0AuL+M33P+6mxFSxbSKZOyp HTsB4lXYtK7byEI5xEKvWJhFtJ4wyxN83S9HLnVw5CpGVwF/OnMle3lE0nYtsC19/U71EzSa7Bv ZuEWjNswa4hu4lJ8RmOplQEJ71tw96JV92PXQkiWizx/nfKXe07UZ1YlmzplyBSaGWTmYL73SY8 qxxLAqtnbh8yJiCTX1VZKqN7BENzCaom7RF7YuO18unIWpaLVq8oICfuBH1K6drUxkCsawSz0ij WHG2+ndg2DedGW X-Received: by 2002:a05:600c:4f86:b0:47b:e2a9:2bd7 with SMTP id 5b1f17b1804b1-4836570e562mr1994595e9.19.1770835802620; Wed, 11 Feb 2026 10:50:02 -0800 (PST) Received: from xeon ([188.163.112.48]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4835d99497asm93175855e9.6.2026.02.11.10.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Feb 2026 10:50:02 -0800 (PST) From: Svyatoslav Ryhel To: Chanwoo Choi , Krzysztof Kozlowski , Lee Jones , Rob Herring , Conor Dooley , Alexandre Belloni Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-rtc@vger.kernel.org Subject: [PATCH v1 2/2] rtc: max77686: convert to i2c_new_ancillary_device Date: Wed, 11 Feb 2026 20:49:41 +0200 Message-ID: <20260211184941.6756-3-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260211184941.6756-1-clamor95@gmail.com> References: <20260211184941.6756-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Convert RTC I2C device creation from devm_i2c_new_dummy_device() to i2c_new_ancillary_device() to enable the use of a device tree-specified RTC address instead of a hardcoded value. If the device tree does not provide an address, use hardcoded values as a fallback. This addresses an issue with the MAX77663 PMIC, which can have the RTC at different I2C positions (either 0x48, like the MAX77714, or 0x68, like the MAX77620). The MAX77620 value is used as the default. The I2C position of the MAX77663 is factory-set and cannot be detected from the chip itself. Signed-off-by: Svyatoslav Ryhel --- drivers/rtc/rtc-max77686.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c index 69ea3ce75b5a..3cdfd78a07cc 100644 --- a/drivers/rtc/rtc-max77686.c +++ b/drivers/rtc/rtc-max77686.c @@ -686,6 +686,11 @@ static int max77686_rtc_init_reg(struct max77686_rtc_i= nfo *info) return ret; } =20 +static void max77686_rtc_release_dev(void *client) +{ + i2c_unregister_device(client); +} + static int max77686_init_rtc_regmap(struct max77686_rtc_info *info) { struct device *parent =3D info->dev->parent; @@ -713,12 +718,17 @@ static int max77686_init_rtc_regmap(struct max77686_r= tc_info *info) goto add_rtc_irq; } =20 - client =3D devm_i2c_new_dummy_device(info->dev, parent_i2c->adapter, - info->drv_data->rtc_i2c_addr); + client =3D i2c_new_ancillary_device(parent_i2c, "rtc", + info->drv_data->rtc_i2c_addr); if (IS_ERR(client)) return dev_err_probe(info->dev, PTR_ERR(client), "Failed to allocate I2C device for RTC\n"); =20 + ret =3D devm_add_action_or_reset(info->dev, max77686_rtc_release_dev, + client); + if (ret) + return ret; + info->rtc_regmap =3D devm_regmap_init_i2c(client, info->drv_data->regmap_config); if (IS_ERR(info->rtc_regmap)) --=20 2.51.0