Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp796537lqh; Fri, 31 May 2024 18:29:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVU+yDEj7LurnH4n3CXJRLfiNrO0PVhR3hZ+FhYBLhtHPeFxznKUbIY+09Cd3p4Af4YuEUt1q0kpUw40r0zaIXzhFtdk9KXwUhWNWrcqA== X-Google-Smtp-Source: AGHT+IGuVG0I7GfF279RrBt94Hg4hBXdgeH8qZQ41AmNTISurYD6b7SnIC+tmkV6B4A1jcWNoQhL X-Received: by 2002:a05:6214:2b9e:b0:6af:26ff:34a6 with SMTP id 6a1803df08f44-6af26ff351dmr7596966d6.63.1717205342583; Fri, 31 May 2024 18:29:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717205342; cv=pass; d=google.com; s=arc-20160816; b=Kc4+YWfjFnrrP9N6vd0NJwHMz7EOfsFSD95uK0PmdhB5AEhFGDCNk46/2X5yEbvq5I Y4IjMB5L9VPnX6myYwk2irYvkM/1wT08ruYDINQZjbGnTjYtnX0fNnmJFVDf74CpAHLC +5nuGWDZOqKk+jKeIv8EtfwR8yAyDhY+MOSJE0vWCCy1BBq5MWeaBqj/rWclGANH/222 sRQcPu4wrgeOu6I0IVgup6XmLkY/u7IGm2rX70rvy8CnbPSK8/i5laa7oxAKWwjCCIkq GVp6iVPoSVTX4y25cMTKhK/Cko0aS9a6o98fKXLYLCKMk+AG46UCmC6Et6CQMPS38WO0 6/Yw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=nsyBYubvsxt79/q9f0pugqP2ozHD/6I7Jc7gSjc9vwc=; fh=pbK4GK++H+tW5tC6x2zxujFmhF2ArPzdDM9M5GSwqek=; b=EqH0QoyUOezsgixfu7jUP248X2BTu0a0CXRq1flZAz2lD8kJDEoEX7lml5AQ6IzeO7 NsiB8aY11xMlqrlDuRXOAXU60GUIgeY/L+OpWyRTU2c/8CDOe5rDI2CVQMEJIM2OwMlE fti2mzI/0UaRYuwHznZ062LQ63q71l7Y7bHQ+4EwXzEKPzu+G3GBo6Km/hDNqNFEB48A YFPDFjRYgZnwcqBADKKbxDHA/2XRe2LCp0YoczjbW2q4KgcpMKS0uHlam/BQ9T8ouPk/ ohOkSZGl7Bz+1IeUCDYYSdz/CE4+2b6CHuQVR2nuTlxUHx9UHQl6DQG0rs5JWT0bEu4k DQwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=cM6v70+J; arc=pass (i=1 spf=pass spfdomain=sang-engineering.com dkim=pass dkdomain=sang-engineering.com); spf=pass (google.com: domain of linux-kernel+bounces-197627-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197627-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b42a142si18801486d6.440.2024.05.31.18.29.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 18:29:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197627-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=cM6v70+J; arc=pass (i=1 spf=pass spfdomain=sang-engineering.com dkim=pass dkdomain=sang-engineering.com); spf=pass (google.com: domain of linux-kernel+bounces-197627-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197627-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 40D3E1C2126A for ; Sat, 1 Jun 2024 01:29:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED53A567F; Sat, 1 Jun 2024 01:28:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="cM6v70+J" Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D4A22582 for ; Sat, 1 Jun 2024 01:28:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.117.254.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717205334; cv=none; b=PnOTlO3zckSGkBHKjMqJkwdb5yXepdmdx0BNQ57QBG6MI0hE6W0XoB+d7om5+/E1TZlN+5zFL1cmHe93nuHr7hDmhFcuUtxiw3Ahkg7uaVabCQhQDS140OeHK4WmDcE7n6p1XIdodj+0IKW+EtilNoeylxNdjujdkCFPe6UQsK4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717205334; c=relaxed/simple; bh=K0dXAdksh+i6GPoOz3SNlGeawSia8gf189LXs0UIoNo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MjsdZPy8YmhF7483DBHWj/5WVDkY6JpY/rrE0cADjTFFPkUr0AZeLiYezAOxXiqtoPC2Ib7oRnsrDiPZOigkdYVwcRZynrEAQICpoGMjp0wYH2qwudyuLTzK8QUZoNsP1+bNV/9Hw169rX1lPFvXvWrXJYQfy9hwTgQxFqvnljg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com; spf=pass smtp.mailfrom=sang-engineering.com; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b=cM6v70+J; arc=none smtp.client-ip=194.117.254.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sang-engineering.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sang-engineering.com; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=k1; bh=nsyB Yubvsxt79/q9f0pugqP2ozHD/6I7Jc7gSjc9vwc=; b=cM6v70+J5+d3xSQIuFZZ A/3qBvufcoRaPa2nruh9GEjYW3DLtKwkSL2rBQ+1oHzsFCy0W1txS0v3zkDGUg/d EAEyN6HlUTmGkvtR7DAZV8jBLs3cm/+rRfLEiKWqorrmlOEOu0kQmJEuKN++2KpH Fyc8j9QVWdXKN7jZhxOy/qx9yLFMv/Mm1Vv+ng6KjI8Xh5b2gARV59csnXVHW6ca J6LYX9ic/GOEP+DFKzY57xrPc91QcwvKUCFM7p8gIjpNEbxdxkzPa3n4OO7GxU+G a5oUxyPOIB2ktZZjq6+j8el0Yohowaxl/1cyf+FLnPNQZRvOfLNwQhej0izb25iC jA== Received: (qmail 1314606 invoked from network); 1 Jun 2024 03:28:50 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 1 Jun 2024 03:28:50 +0200 X-UD-Smtp-Session: l3s3148p1@K1+wBcoZnORehhtB Date: Sat, 1 Jun 2024 03:28:49 +0200 From: Wolfram Sang To: Guenter Roeck Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-kernel@vger.kernel.org, Armin Wolf , Thomas =?utf-8?Q?Wei=C3=9Fschuh?= , =?utf-8?B?UmVuw6k=?= Rebe Subject: Re: [PATCH v3 2/4] hwmon: Add support for SPD5118 compliant temperature sensors Message-ID: Mail-Followup-To: Wolfram Sang , Guenter Roeck , linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-kernel@vger.kernel.org, Armin Wolf , Thomas =?utf-8?Q?Wei=C3=9Fschuh?= , =?utf-8?B?UmVuw6k=?= Rebe References: <20240531230556.1409532-1-linux@roeck-us.net> <20240531230556.1409532-3-linux@roeck-us.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yq7qukcenpm3ibk2" Content-Disposition: inline In-Reply-To: <20240531230556.1409532-3-linux@roeck-us.net> --yq7qukcenpm3ibk2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > +/* Return 0 if detection is successful, -ENODEV otherwise */ > +static int spd5118_detect(struct i2c_client *client, struct i2c_board_info *info) > +{ > + struct i2c_adapter *adapter = client->adapter; > + int regval; > + > + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA | > + I2C_FUNC_SMBUS_WORD_DATA)) > + return -ENODEV; > + > + regval = i2c_smbus_read_word_swapped(client, SPD5118_REG_TYPE); > + if (regval != 0x5118) > + return -ENODEV; > + > + regval = i2c_smbus_read_word_data(client, SPD5118_REG_VENDOR); > + if (regval < 0 || !spd5118_vendor_valid(regval & 0xff, regval >> 8)) > + return -ENODEV; > + > + regval = i2c_smbus_read_byte_data(client, SPD5118_REG_CAPABILITY); > + if (regval < 0) > + return -ENODEV; > + if (!(regval & SPD5118_CAP_TS_SUPPORT) || (regval & 0xfc)) > + return -ENODEV; > + > + regval = i2c_smbus_read_byte_data(client, SPD5118_REG_TEMP_CLR); > + if (regval) > + return -ENODEV; > + regval = i2c_smbus_read_byte_data(client, SPD5118_REG_ERROR_CLR); > + if (regval) > + return -ENODEV; > + > + regval = i2c_smbus_read_byte_data(client, SPD5118_REG_REVISION); > + if (regval < 0 || (regval & 0xc1)) > + return -ENODEV; > + > + regval = i2c_smbus_read_byte_data(client, SPD5118_REG_TEMP_CONFIG); > + if (regval < 0) > + return -ENODEV; > + if (regval & ~SPD5118_TS_DISABLE) > + return -ENODEV; > + > + strscpy(info->type, "spd5118", I2C_NAME_SIZE); > + return 0; > +} What about adding DDR5 to i2c_register_spd() and dropping this function? --yq7qukcenpm3ibk2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmZaeVEACgkQFA3kzBSg KbbgyxAAqE+ScpBLU96XG/G/fwdHnYzmRzPSIDh3hS3WrGTiKbiADyZdKDv0QzI2 ay8NiTS5Qbrhsmwym+FIlTSEGHbUeOy3tfiwHCpEb46NdWKWkVFec8KjZh03S7JW Krkv/V5iiyGTugcrxtzLkBQUTBZQZxped1RcfbDBX9+CjGnzNHWe3CskTU0Zk9br m1Xb6BRg+rEzpiaGdDbOecQJeGwgAj6x7TEo5r5qeFA6gqJzPekcfrNayrnMPDL0 VQSpaaL73YCZwytnSroDx2qunLhbL+6QTvzNZ/1760oe+m95V7Cc2wPXbFS5X11c sikHnP7ZZMoKZ5ZzCceNkJdBxJqTlZTIZ3MLqtn9jZ0E5KT9yStvBdsdhE0T3t4Z wv4hLRzPW3NgANZu2AKki4G+ync/k4vku1kr0tPeuHCQA8OiuGQG0x3MRCst+8Uo odfRZwMtWJtuSEVBXfvD2QSxP9E1AYqRDt1lJQtD4zFaul/w78w9ng/uYgiyhzuY SS0OcpayaeobWd/rxviy3yKO3ZHwcTlr43sxiqaiOtA2Touq50cpMCa971zFkWOp 0XrwfYbSCsUus8RDb5z7TliJA1zVhNy547ao7/uRPj+BUT1/2MCd+4bZ1j7eTami p01vZXUSy1Tk2LedVl4012X8LGTy0olO6ingqNsMVfOkW91Lbv4= =+2io -----END PGP SIGNATURE----- --yq7qukcenpm3ibk2--