From nobody Thu Apr 2 18:46:23 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