Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp70653lqp; Tue, 11 Jun 2024 15:13:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXeBQFNdqtp7y9DKuUyaV7fwlwEQcv2SPhkhcNKaO4Y8TfdBh7i0L9bt1Mrrou83XqPFGt6/Osei1TFRmqM1hZkeVOS/VhP9AeN+R35vQ== X-Google-Smtp-Source: AGHT+IErCEYldHQu6wuGlAyhqH5L/SUND1gUL7YDpXpdGi4Y81xDanZBjvF5vXVc3fPfxNypn0GO X-Received: by 2002:a05:6830:1010:b0:6f9:8431:86a8 with SMTP id 46e09a7af769-6fa1c23cf1fmr60558a34.30.1718143995941; Tue, 11 Jun 2024 15:13:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718143995; cv=pass; d=google.com; s=arc-20160816; b=raDj5p1C2S2u5tKIX4lhqA1bURjhHAWvY4Z6FL5G/92XYLkKAQOsjYljxYpwdnFlfJ nRAXbYfWTG4jpP+6Sb8QfwPymfLylO5g+3gL1+/na2mKSnxH3wXvFVYgul+WZQkqNade LSYDWKBxANrVjXHhImUn0N0Z37LuwndkI0NUgzpRpnEPDev1a34PEmrcnaB0i9IDqSOA Rk04V1jJG6mhLcXTgVF5QwptoSuMR0t6ZqWWAnt6RdHpk55C71cWszLNklpwsA/ZbSaL lyiBS8D+eSB6KRssOuMnkI3aG/NO4wmaZaN64Cj3eRn3n/+HUSFEqYZqYqopwRH2X0yh jc0g== 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=9IZIpdPzR9DR3MCp+AyrdUtLauredv0OWoF1WwgDZ50=; fh=JsamP2cClvqSt6rwUtFPb04M2B9jTmy2hqKoZEUym1A=; b=X9THIPDiVRJSYfdh1FlfQo/btPGVKJu8Rps+H77EwPbgfV96AZBft5Mx+JbcpwTLaG 25sS3DN9SyoQbFudUZ2mGHQLmiexgt/PZrmBzGhXgPIqMFx7INs1NDSYn8Kur1tYKGNr 5TGzzTtHNdlZk6nYfI+OpcoovdM4dso1SM886W9MajoR0StlxN0NzvhukIj7xjHNU1iD OUiiV6MK0sNl+w0YvUYmh9y3MtxsNtywFBwNjQ7TZHXk0/DpVOMa6kpUBfH+N6wMDOIJ kKmohQYKZwY+76n+JQLaVv22dIzAW8aIGugc5R3ZN4XzUXV8ezOGiFRDtwIP5yJbcrP+ e+6w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=C+9rKeQk; 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-210651-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210651-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-7956b889d24si647075385a.332.2024.06.11.15.13.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 15:13:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210651-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=C+9rKeQk; 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-210651-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210651-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 A4AB01C20DDB for ; Tue, 11 Jun 2024 22:13:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9469B15530F; Tue, 11 Jun 2024 22:13:07 +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="C+9rKeQk" Received: from mail.zeus03.de (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 68CC7154C00 for ; Tue, 11 Jun 2024 22:13:01 +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=1718143986; cv=none; b=h/aLHRXmfqpJIwCWkt9FL+wZwOnRm6jTKYHRjTYC78JB79CYST8pvvZz68AEH3ONDJ/IcI2fPFHslEexh7DBT6ccmRKAMozXD9gYJ2PUTzHAdIAYgetoyQ23ywHAGzZB9YPN14KlqsWsM4LwjWSIO6bcyH95vFgklu+jzQxRLNg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718143986; c=relaxed/simple; bh=ntignwSd5BkQDAoVuBygKbCneHpXi8rp0ewb5JbG+YY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kPdwoKXQxzRsn4bsOXun6z4y6z64Fc19pJg6hKVgfCu6CacKPT540BquKYZpVpNIsEgiVcl9alhcKKRMc9Un370tCxiqR5U7Wd4rjuZXIk5Mrqi3GrO07XjfSf26lj5voPdz/RkuEB4U6mEVTme/AA18lyv+U0YIf9GVqHJ1YQo= 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=C+9rKeQk; 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=9IZI pdPzR9DR3MCp+AyrdUtLauredv0OWoF1WwgDZ50=; b=C+9rKeQklbHFCmWU7lCN bd8ThpgmhSUQLC44BUTfUIFi1T9mP5KlAvXOtTzCHelbdlfqPj5hvilEzhXrxgl4 hUy75vkRoK1CUGXJx8D4RVm/EI6XGDfe6RftoFbE8H+rEJs5pF1x3fn+4ASgDy1N 44u1quA9f3LqtE2ervu7TH49wlNaQfre15O4lJ0btF9sIhbri3Zk+vl+jYPzvbdt u2tELFsDEem2FFj9tLB4pO9RjnpbnSwTllvJNM+B5mb8FMQMwUFLrsyNe/0e1A+2 vDv+kywG35AuhNozt5g2fhsz6gcHqf2ntk84/EjuFRVzNMFF/o3ciAcDo7/Lpix+ Bw== Received: (qmail 574999 invoked from network); 12 Jun 2024 00:12:59 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 12 Jun 2024 00:12:59 +0200 X-UD-Smtp-Session: l3s3148p1@bqWOkaQaeIxehhrL Date: Wed, 12 Jun 2024 00:12:59 +0200 From: Wolfram Sang To: Farouk Bouabid Cc: Peter Rosin , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Quentin Schulz , Heiko Stuebner , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: Re: [PATCH v3 0/7] Add Mule I2C multiplexer support Message-ID: Mail-Followup-To: Wolfram Sang , Farouk Bouabid , Peter Rosin , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Quentin Schulz , Heiko Stuebner , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org References: <20240611-dev-mule-i2c-mux-v3-0-08d26a28e001@cherry.de> 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="bkvmb62faawxzci5" Content-Disposition: inline In-Reply-To: <20240611-dev-mule-i2c-mux-v3-0-08d26a28e001@cherry.de> --bkvmb62faawxzci5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Farouk, first of all, thanks for the patches and tackling this problem. I have to say that I have many concerns on high-level, though. I hope to be able to give helpful recommendations. > Mule is an mcu that emulates a set of I2C devices which are reachable > through an I2C-mux. I am not 100% convinced this is really a mux. Another possible DT representation could be (pseudo-code): i2c-bus { mpu@42 { comptible = "mule"; reg = <0x42>; subdev@0 { compatible = "subdev" reg = <0x00>; } subdev@1 { ... } } Dunno if MFD can handle that. Maybe someone else knows? If all fails, I think you could write an I2C mux-driver which uses the above DT snippet. It should then do: - write the mule config register according to 'reg' of the subdev - replace 'addr' in all 'i2c_msgs' to the addr of the parent mule device - i2ctransfer - restore 'addr' in all 'i2c_msgs' to the original addr A little simiar of what i2c-atr.c does, check Documentation/i2c/i2c-address-translators.rst > The emulated devices share a single I2C address with the mux itself > where the requested register is what determines which logic is executed > (muxing logic or device logic): This design is... unfortunate, if you ask me. But well, things happen. > The current I2C-mux implementation does not allow the mux to use the > I2C address of a child device. As a workaround, A new I2C-adapter quirk is > introduced to skip the check for conflict between a child device and the > mux core I2C address when adding the child device. Not acceptable, sorry. The adapter itself is fine, so this is clearly not an adapter quirk. The client is what is quirky. I don't want to maintain patch 1 because of this one "creative" design of a client. I think we can handle it outside of the I2C core. So far understandable? Happy hacking, Wolfram --bkvmb62faawxzci5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmZoy+cACgkQFA3kzBSg Kba3axAAgZhZa5f9hUe4bSz0GKDi69RP0Z8Vz038So0ej0oN/S6UtQikhS+zh1Gb ZJqvCEfw2Gzm6dK8QgpLNg8FsUCpiT1m2ZIQItoKUELSzGaL1R3svGj1cZuR268D Zr6gdsbFDjZwg+Fa8roHfCB6+dyIyYuvcHPgckpFtNB24knAN7l13wlW+1Z32/xP 1OEOpThyD+Wq4R6gvJ3Yg0ZnJIJEu+qH+9Pm2ItalPsHgoZNtVTEKkCyLbki2dzZ 5j+d3sl7avBP6mEeOFSCO+cJtf+D6Z8VPx/SlA7A+iSCJugU4t03u/OJyyDDvmhj bynHKAh6CHdzVlNdFvEjP4Hk5wPpqqcvzGDgNt+4zjq1zSf19hlaSS0fVfgT8QsN IjRMH/5nsHEadFlOwTkSKIbG5RTM3WFbAdtnWrh6UgYVZyDAClm4AsC1esxgNOOm kWCJV8yrc82BFovMQs0fTwZT2fMaLZoQNGGtySg9wtz+SyQfXTAkM59W2QuXzxpb S4OUDgdv1lOuW9PG2tG0rdLlwkG0qTYKzwDrdcKoSMNjbWJcRC++/c9++juwPJv0 fM9oS0/wZjRGiDZkXMbKhdaQ5EoJOZGJxsZylgeHt8G77Rqy06nAkVqZBXRb1CP0 VWeWBqaEGvpliLkVTp7Psfd6G0TaMza0/geIiOxw/puIBHVMbfU= =guh5 -----END PGP SIGNATURE----- --bkvmb62faawxzci5--