From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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 75C761A5BAE for ; Sun, 19 Jul 2026 14:08:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784470084; cv=none; b=lKcO/Wsl3MRWqklQif0bUYotgXcw3xbwy5inQ84t7OeuBN17RIbXVv8AMahtSoqpxDAptQsR10zS5rfQlA2708mp6OKCvsDP9PNz+dckUdkuUn2Ga5BsJtLxFg2mU9O9qr7XhvwOyfLo+DZem2NYi51iB8CFuS7rdAoEyqbEFy4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784470084; c=relaxed/simple; bh=9DwiF9IdEisrQm031eI0iEyPpeWjFiGOio82h+Gg4/g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QFiAFmUyeowFNBJQUpROEQWnONJ2NG7XcMiFQFh64u+B21qrD2uujTjB6xuG4y4kGepVJcUJFbrODJSIQ/UvwT0jWsF6Xh4qVv20LNWAk8S8FKEFGIqk6INlvJ75tkLvPHOHC5u5ONaWl1qTvImKrU5mfmEjcidz2TEsVPPVAws= 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=eBxyfAwA; arc=none smtp.client-ip=209.85.167.52 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="eBxyfAwA" Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-5aebd52488cso9776347e87.2 for ; Sun, 19 Jul 2026 07:08:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784470081; x=1785074881; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=hviuhQxk9tmkFzbE+ozJvymbpZxDhoz38nMQh318+So=; b=eBxyfAwAg/ui9kYVOj9qrEyS3BuwhQ2DU+EAkMKYqMXb/UzhBJGH9T/LN8aYcK+GYL 5OnaMduvL+jnG9nAGOfYtItsOgVqPVJVvrQqltmoI4BfJtkTZrHTH4xgnO5daE0DDisn o+N0lsTsERjD7FHc3GlfUzHM5erhTBPgQniiC1r7ebWWcOaMhrusKAicpljvbZEyCnGJ 4Sz7O9IwELAgALNksezIOiHazWE3XmlQKBfS+tLOTHS5afIeuiFIUZby2Ew9yXfyn774 VDrd8ALzPMUZbeQiZIMn3SPhEFpspy+cR+hqXGSKyuFp8HnZnf1IP4aNrWnLXZWrYO4+ KAFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784470081; x=1785074881; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=hviuhQxk9tmkFzbE+ozJvymbpZxDhoz38nMQh318+So=; b=JZ59Klta4TP8ZUjNi6JVVk5FhPPv4RjgN8UYVwHciY3e2DuuhVTacjSNXi6PSGP31z zbM7AOG4c78APZvJ+XZIuFXwAaMbQRzYRz4rS46makhS1yJENktR1FHXHVyHdFOYQmHS ohoNUTAkV4hx+FwmcB0vLLgWvVO8YuPmU6+/xfb6v6A9LF/h9OACCmCcZGmreOepuMH4 gLUzfyXaoUpjdNQWHq6Aq/Ayt9zhaJ2VUMWaq+timOgd3BkYxSgUFexS3/r5z9u3navb Uu2IahQlNHz27V0XnfKxhdx9NzLOXxgsJstgTht2hO8QPd2AxVfIVKUsFzlykRDaQjiH SkUQ== X-Forwarded-Encrypted: i=1; AHgh+Rqz5FkAYtn1vaXNNnlaTASh2Sw0G7URrI36qiLDCyhPs9MUnbTsp4ZZFqSaeVPVOCQkYG1pE5cWkIcU01s=@vger.kernel.org X-Gm-Message-State: AOJu0YxU8oAFZf8EwNcGLji6V7x6agwknapLN4y4ZqkY5m0Wu2mCm8Aq RYLBat7+XBWMwYAFr9+uHYXsrIIvrMv7yRMVBjBtIBED0Dl76wsfP+X6 X-Gm-Gg: AfdE7cnL2QzMiWR9nT8wIajwQQASPyzY+8T4ikhrNpK95A5p4JfPvRaNEKtsVOVlwQc eRGEVGv+4s3IfDwzuiqg1ZLp5KGOUV0foZOU6PfPWoWOce1dcvkxNBZlBljsnxCue+54YSVMBBp aRBna/r9bxHO5DXAEAGkHsAT9sI40eupVl1iphp572n8WXB1LCg8aaFf6RnAWYDh6adHmKocdJB cTzlQmD7Hn6e+jJkCWUNAxQHCtELsnP16ISdGwEwHvs1CARDgriEriY6tFyiwNoejx+XcU6gjB0 CKuTlIjlhJvAlJAJ9gV6hqe97USjb9sqqYphUDFlTSBX2GocM8zmjuSSCIqIlOwnzeHddlWXaZb b30RoZZVszWIkDwaDZe5LsIAp6KERDEPPTbsCi1bk58rK1ptWrDkRm8ViCSgH1f5J35afqAZkeR cPQJmzBJ7c3hcu7dNN+LE7qPtVv8f1R6i3o0p5jN8= X-Received: by 2002:ac2:5fe9:0:b0:5ae:b489:b844 with SMTP id 2adb3069b0e04-5b28f9acaf9mr1417664e87.32.1784470080335; Sun, 19 Jul 2026 07:08:00 -0700 (PDT) Received: from gmail.com (83-233-6-197.cust.bredband2.com. [83.233.6.197]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5b291e2480csm1794315e87.72.2026.07.19.07.07.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jul 2026 07:07:58 -0700 (PDT) Date: Sun, 19 Jul 2026 16:07:55 +0200 From: Marcus Folkesson To: Peter Rosin Cc: Wolfram Sang , Michael Hennerich , Bartosz Golaszewski , Andi Shyti , Andy Shevchenko , Bartosz Golaszewski , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v11 2/7] i2c: mux: add idle_state property to i2c_mux_core Message-ID: References: <20260713-i2c-mux-v11-0-72bb8af8ee8c@gmail.com> <20260713-i2c-mux-v11-2-72bb8af8ee8c@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hi Peter! On Sun, Jul 19, 2026 at 02:39:34PM +0200, Peter Rosin wrote: > On 2026-07-15 21:02, Marcus Folkesson wrote: > > Hi Peter, > > > > On Tue, Jul 14, 2026 at 01:29:01PM +0200, Peter Rosin wrote: > > > Hi Marcus, > > > > > > Sorry for the very late feedback. > > > > > > On 2026-07-13 09:19, Marcus Folkesson wrote: > > > > Muxes treat their channels differently when idle. > > > > Let the mux core have this information to make it available for > > > > internal use. > > > > Reuse the same state values used by CONFIG_MULTIPLEXER. > > > > > > > > Possible idle states are: > > > > - MUX_IDLE_AS_IS: Leave channels as is when idle > > > > - MUX_IDLE_DISCONNECT: Disconnect channel (set HiZ when idle) > > > > - : Enable channel n when idle > > > > > > > > Default value is set to MUX_IDLE_AS_IS. > > > > > > > > Signed-off-by: Marcus Folkesson [...] > > I think I will introduce a few defines in i2c-mux.c then; > > > > > > #define I2C_MUX_IDLE_UNKNOWN (-1) > > #define I2C_MUX_IDLE_AS_IS (-2) > > #define I2C_MUX_IDLE_DISCONNECT (-3) > > Hi! > > Please keep AS_IS as -1 and DISCONNECT as -2. Using different > values will make it difficult to get rid of the use of the > defines belonging to the mux subsystem in case the actual > value has crept into some .dtb or something like that. Got it! > > Also, I think the right thing to do is to put these defines > in the i2c-mux.h header so that the drivers can find them. > I assume .c was a typo? Yep, it should be i2c-mux.h. > > > [...] > > > > struct i2c_mux_core { > > > > [...] > > > > /* > > * The mux state to use when not active. > > This is not 100% accurate. The value stored here is never > actually used to set the idle state. The idle_state here is > only what the driver has declared that the idle_state is. > Perhaps word it like this instead? > > * The mux state used by the driver when idle. > > Agreed, subtle difference, but... ... even better. I will change to that. > > In the future, drivers (most of them) could be changed to > use this variable to store the actual idle state. But, as > mentioned, that's not easy for i2c-mux-gpmux since the idle > state is under the control of the the mux subsystem in that > case. > > Cheers, > Peter > > > * Possible idle states are: > > * - I2C_MUX_IDLE_UNKNOWN: Unknown idle state > > * - I2C_MUX_IDLE_AS_IS: Leave channels as is when idle > > * - I2C_MUX_IDLE_DISCONNECT: Disconnect channel (set HiZ when idle) > > * - : Enable channel n (starting from 0) when idle" > > * > > * Default value is set to I2C_MUX_IDLE_UNKNOWN. > > */ > > int idle_state; > > > > [...] > > }; Thanks, Marcus Folkesson