From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 146BAB67E for ; Mon, 22 Dec 2025 14:39:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766414364; cv=none; b=TPRvhgYc0mAtJcOv1BDNKXiYuac/M+0R4syoFOfT7uJemUaxwPWX7ztXZkM2eLdqdFp6zGfcErzsMIZZwk4SELAkuhjNTVu5OzZcXFoAISfUEFaMxyMmikdNzim3g+xWSKVAE/DbjkQDXWUzoSaI2brFacmsZArNSW7IqGQ/KKQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766414364; c=relaxed/simple; bh=DoUjpY5UCM+p1ACxy0sD1JEJ5bi7jqykWMV8BytUF/8=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=BSqomtv0y08Ec3XFeUNlxo/StFdAkvvS6QDfuVbVW2+DEOeCVAB6pTXdohXqtUost/lc1sjSLDnElS0HTWbKPgn4boUPx/t6Dx5VHkmBVpx4mlhxiqYgCqSVpA8SbRfoXJqvSXFcAyDbdNMfwsYJlG6B+h0253xRlBbIlsZvhzA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=vzHhPvaG; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="vzHhPvaG" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2a0a33d0585so37657295ad.1 for ; Mon, 22 Dec 2025 06:39:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1766414362; x=1767019162; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=RDtdE0Cxu7Gss8LSXL9OkFlTQfXFyy8lzvBUAY3ZMaw=; b=vzHhPvaGL0IE+etY4rw5s+oEEaTQqL5/N4H/7HCXgPCrWNvCzN7lqQEZ7V19j2iKlV 49S9juriNWf/IstxIOe68lRRdNiUnKaMjCExydPIZ5WauiGxqBYq4s1qFnsyp2nGcljI p+ftXYy5b+/oiVF/0/F7vF7IBT607z+lxmSCkJw2coStEyhordXIUtoKwQH+MP4dtzw0 RUdR0f0AgD+54XTbg6F5QXg4zNy+UCwXL3tG/FPiLV3u3YkGELEid/X51RECPxK0uiL3 C3SXyuRd2JSPhu1qoYW9pSr/4sfFUvOU1U4Re5UA/rEOrYLnCz91aUcjerJBWbGX40Xl OoMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766414362; x=1767019162; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RDtdE0Cxu7Gss8LSXL9OkFlTQfXFyy8lzvBUAY3ZMaw=; b=fS5j5aVSiqx6sktn8tJmKn65G4KgvQuNVtTTgocrphWyk91j+EGGJOtCeronUbBvNH 4Tm08w5elnCU7dYnum1OqAYMJGWsMWcJzcrbcjRpYxHO1vWaamx8XAoJcbCRYwHRzRpD TGVu0bL6GAGyHgKeaV+dj2TTu5zrx91FsbuJMEkBThkNpChzvYXONq/IybVZjjoMAm11 rU8+7W872eeADnxMiz6ZVeSKmVXSdJFYJO5cYZPrQR3IcXeHAvFQQsQk/cByEhZNedZf 2CBgL6Lpxy6GYNv33Fusj/m9oqyfh/8C/uLapxkw6P/cFZMjaazejKMoChaBuIHHDJfO nR4Q== X-Forwarded-Encrypted: i=1; AJvYcCX5ZU5E5BkuaYbOlH1bONEqnXUhKa7xJg/3BeXK7lHYL8QZi9vF3jpL516gztjrzGAokespQiVHjKhHMo4=@vger.kernel.org X-Gm-Message-State: AOJu0Ywp7n/QqDyYQtGjQTH5c/FJsd9fG+WRxJQWS58TZ2YPao/Ca4vp EAfYe0GeqzSCZjimOiqdO4hh4p9eVGpbIFNmtb7UARI2MP2GR2SNvukIDhKaroQnkkg= X-Gm-Gg: AY/fxX68TRG9Jht+1neqAromIWxSLoeW1XngEM7EbE/Z2zB/R3dO3nmsj3kl1to4C3u sXWjEqX0pMGqRbjIxKuRduATcQrMg6Jzak0kq002DReI5Y3O3jb6VoYvmKg65G86iQWnnSIunsn UEnE8wAvv2nj7kLgQqTnh+N7X1h+AFFo59QeTGuxbr1cSxYeAtlQEY0zh1wllNgiASgOKNPs7qY 105E2tG9KfrM9qmjPYnqe4Gs5doPgcRT3IoAu/D88njCwpMsZ9AD4RC9PTe/gib4s2vDS5+Dkqt bAxaJBzJVPAQX6XjlZbiUpS8sUN4IdkC8tWE5VeLQT5axcsV9g+hwA4Ear258EJWiVXB2RQLiNE VSdiPJneLC7Q3vImTvudZQt+h8cGOJHHx/oLTrwN3ge7uIa2rNMUmuuCqAvMJROLka/6lDhItvc YXhSSx3tWaSHi/376qKQ== X-Google-Smtp-Source: AGHT+IFT0I8sDRtDf0BsCDJnVlRiRHCTAs1BEHb9zVVMfBwunpVujshPU39ZkSJmVXwxlUzcoBFaJg== X-Received: by 2002:a17:903:1105:b0:2a0:f83d:c321 with SMTP id d9443c01a7336-2a2f23289cemr104685085ad.23.1766414362089; Mon, 22 Dec 2025 06:39:22 -0800 (PST) Received: from draszik.lan ([212.129.78.214]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a2f3d77566sm101023635ad.97.2025.12.22.06.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Dec 2025 06:39:21 -0800 (PST) Message-ID: Subject: Re: [PATCH v3 5/6] soc: samsung: exynos-chipid: add google,gs101-otp support From: =?ISO-8859-1?Q?Andr=E9?= Draszik To: Tudor Ambarus , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Peter Griffin , Srinivas Kandagatla Cc: Krzysztof Kozlowski , semen.protsenko@linaro.org, willmcvicker@google.com, kernel-team@android.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 22 Dec 2025 14:39:20 +0000 In-Reply-To: References: <20251120-gs101-chipid-v3-0-1aeaa8b7fe35@linaro.org> <20251120-gs101-chipid-v3-5-1aeaa8b7fe35@linaro.org> <653202f78f060b7e001b78604dd26d0f18ab76f9.camel@linaro.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2-2+build3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hi Tudor, On Mon, 2025-12-22 at 16:12 +0200, Tudor Ambarus wrote: > Hi! >=20 > On 12/19/25 5:10 PM, Andr=C3=A9 Draszik wrote: >=20 > cut >=20 > > > =C2=A0static const char *exynos_product_id_to_name(unsigned int produ= ct_id) > > > @@ -93,19 +99,53 @@ static int exynos_chipid_get_chipid_info(struct d= evice *dev, > > > =C2=A0 return dev_err_probe(dev, ret, "failed to read Product ID\n")= ; > > > =C2=A0 soc_info->product_id =3D val & EXYNOS_MASK; > > > =C2=A0 > > > - if (data->rev_reg !=3D EXYNOS_CHIPID_REG_PRO_ID) { > > > - ret =3D regmap_read(regmap, data->rev_reg, &val); > > > + if (data->sub_rev_reg =3D=3D EXYNOS_CHIPID_REG_PRO_ID) { > > > + /* exynos4210 case */ > > > + main_rev =3D (val >> data->main_rev_shift) & EXYNOS_REV_PART_MASK; > > > + sub_rev =3D (val >> data->sub_rev_shift) & EXYNOS_REV_PART_MASK; > > > + } else { > > > + unsigned int val2; > > > + > > > + ret =3D regmap_read(regmap, data->sub_rev_reg, &val2); > > > =C2=A0 if (ret < 0) > > > =C2=A0 return dev_err_probe(dev, ret, > > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 "failed to read revision\n"); > > > + > > > + if (data->main_rev_reg =3D=3D EXYNOS_CHIPID_REG_PRO_ID) > > > + /* gs101 case */ > > > + main_rev =3D (val >> data->main_rev_shift) & EXYNOS_REV_PART_MASK= ; > > > + else > > > + /* exynos850 case */ > > > + main_rev =3D (val2 >> data->main_rev_shift) & EXYNOS_REV_PART_MAS= K; > > > + > > > + sub_rev =3D (val2 >> data->sub_rev_shift) & EXYNOS_REV_PART_MASK; > >=20 > > The above looks a little fragile, comparing register offsets between di= fferent > > hardware platforms and macros, but I guess it works for now and isn't r= eally > > much different to before. >=20 > Right, I thought we'll get this in faster if I keep the old style. >=20 > I can introduce a drv_data->get_chipid_info() method and add methods for = exynos4210 > and exynos850 before adding the g101 support. It duplicated a bit the cod= e when I > tried it, and I chose to keep it as it is now. Happy to switch to a drv d= ata method > if you prefer, just say. The above was simply an observation, and as mentioned it's not really worse= than before, therefore OK to leave from my pov. Cheers, A.