Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1160564lqt; Sat, 20 Apr 2024 03:22:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVVKp7AkL3U6nC033m+uibXATeiuR24eRRewQMfkhu9Fzw+/oo8ywwKDSkLAXk0UeJtpROski6/2dlKxw7iKvXg+qxsu4URsUv29mI7NQ== X-Google-Smtp-Source: AGHT+IF2D1fUNX6c7EqLp+3iiekddU/npAdRODsq3ZVG2hMKbYnDzoeXsieLAufojbDZTf8+Vye7 X-Received: by 2002:aca:1214:0:b0:3c5:eb7b:ed1a with SMTP id 20-20020aca1214000000b003c5eb7bed1amr5005744ois.13.1713608574153; Sat, 20 Apr 2024 03:22:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713608574; cv=pass; d=google.com; s=arc-20160816; b=XVIQtO9jku/lttyqtNunfH07Qjan3Gj6VVVS2g8ZVF85LtMG3QWFSttNVwNGISBc2m E32O50Oqd5j4kn7XvEqDD1P/bmDb/63LWIEeLtHnZ5b97Yb6X2lsC+ZYnUwgyuT7UjJe 8hWE5sZsFohr0/LUwCpAyfkk6jxeXmrmxvtDSKMntuJoLWBlAdZ/jmdr0BlQXEngURFs UZ5Wut9UJRq4Vk0LrjtpFs06KNdGTv6KKVs15aerPdpmqAjtnxQtAOv03XqvD3T+rpQ4 5/S9QhQ0JBie2oLC9i14x5O7gNhMIB8QIi8CcIE4Ir9fwAPeKQztaCYv304taD9bL1MO qX7g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=+aCDYtO2eb9ZsDjH5DFzMoO97u9GjoMbqSdfnEbn894=; fh=ldXEKwJJ1HiVrYlYKvL/MjC83RoaLBqC0PlPHA6Dt2A=; b=DZU2wWJIefYeTxUfUpTSNQT6ZIzGuPZwN23d0LMt0eqktH1KPYrd7MEiZl27eacxm3 7uKeli/PlfGwKm23QwZ/1atfU6Aek/kN9t261zSEEjX0/hshYW53Z3f7mjQBrPCaVA64 89nChMq2aWcVsIR4ONoBwmAVbLhtTTn3Uxf2oDx7lZJBdV80Q30AIEgoZcnx8k4iPmTa HFIUl3hCQtSntNFzqZxcePbWVE/XW/TCSSS0WTj+VZZav0Tcdb/5tOSgzNXSHO7Wd30y Qmn5U5mDKe//U7pF++bNolQAnvYzdkaii0xJol15/pAx92B4xwlrDOWvFZ1u+Q+H7H4i jPag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bpycxb1j; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-152225-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152225-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 u2-20020ae9c002000000b0078ebc07c4besi5752596qkk.661.2024.04.20.03.22.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Apr 2024 03:22:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152225-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=@kernel.org header.s=k20201202 header.b=bpycxb1j; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-152225-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152225-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 D8F4C1C20C4C for ; Sat, 20 Apr 2024 10:22:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D32518041; Sat, 20 Apr 2024 10:22:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bpycxb1j" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8A2D9EAE5; Sat, 20 Apr 2024 10:22:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713608563; cv=none; b=Gy2u9iWiatA4JXuWt9ekMDYDb2fVhuxxFvdhHWKiuYp15Pjq1hsw/K6Nski/TVsERHM+wvUgOXCgx4Juxz3SZQAU4KY66oIJEzswvbxxuaWXDKmIUIqS3iPDTGzhNi3v5I4bWxl3Dle3zWF1dfhBDYd2n/UIoEM+kFx8JXlu3wY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713608563; c=relaxed/simple; bh=KRtH72COXg4XKcrIj0lhwKQkoqKmJzEaOOAWH2FjFQk=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VbJ2Z+l8Tf3rP1lpBVKt8o4GKosL0p7dU1SA2h/0cj9g2piIs1fI16MFnn0ynWyG+8dURcaRkBLt9SlmbRt0CQpXIqfLSWpSebopVLusf7kou7OVQDQL+MnyHYAochmgpLU5frjYSpN+3PIAa/hxNYogsCwwA7JOehKgqJqZf8o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bpycxb1j; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B33EC072AA; Sat, 20 Apr 2024 10:22:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713608563; bh=KRtH72COXg4XKcrIj0lhwKQkoqKmJzEaOOAWH2FjFQk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bpycxb1j1WgaWm62gv8gWE8Dnz0r7rYgTJSE8LHqlRvPNp8kJ5wAP9Qb+1CtFtkAz ODoY/c2HrPIg6z9fwrqtBTrv+4LV4xrfj4LvYz/1olRC1WHGFFLsfwJkjTnGYBTuIv wheBxPgi6UtmNeL6zkuwYDSGpqZ1qhQJOLXLz8uv9pIReEHWGbY9HwvYg77xEkUAp8 nozbx89XxKU3lkudnk6IJYL9Rz/5eRHG8h1rxxDJjfXUZFEmwsmUADxufVVdNWjgLu FHrOs+oJryXceLjidSeArlk5p+iQETS8YBw03LEkmpC9gGjrOrmSrfs4yqOxQW0Tn+ uamdLgJzepI3g== Date: Sat, 20 Apr 2024 11:22:27 +0100 From: Jonathan Cameron To: Nuno =?UTF-8?B?U8Oh?= Cc: David Lechner , Kim Seer Paller , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Liam Girdwood , Mark Brown , Michael Hennerich Subject: Re: [PATCH 2/4] iio: ABI: add ABI file for the LTC2664 DAC Message-ID: <20240420112227.68577ac0@jic23-huawei> In-Reply-To: <79734a9f54e320cd09aab83015f1c0e6d93e700c.camel@gmail.com> References: <20240412032102.136071-1-kimseer.paller@analog.com> <20240412032102.136071-3-kimseer.paller@analog.com> <20240413162517.4644b649@jic23-huawei> <79734a9f54e320cd09aab83015f1c0e6d93e700c.camel@gmail.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) 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=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, 15 Apr 2024 14:45:52 +0200 Nuno S=C3=A1 wrote: > On Sat, 2024-04-13 at 16:25 +0100, Jonathan Cameron wrote: > > On Fri, 12 Apr 2024 16:26:17 -0500 > > David Lechner wrote: > > =20 > > > On Thu, Apr 11, 2024 at 10:21=E2=80=AFPM Kim Seer Paller > > > wrote: =20 > > > >=20 > > > > Define the sysfs interface for toggle capable channels. > > > >=20 > > > > Toggle enabled channels will have: > > > >=20 > > > > =C2=A0* out_voltageY_toggle_en=C2=A0 =20 > > The big missing thing in this ABI is a reference to existing precedence. > > You aren't actually defining anything new, it just hasn't yet been gene= ralized > > beyond 1 device (unless you include PSK / FSK DDS drivers that are 'sti= ll' > > after > > 13+ years in staging!) > >=20 > > This patch needs to be generalizing that documentation from the ltc2688. > >=20 > > Probably in sysfs-bus-iio-dac > > =20 > > >=20 > > > It looks like there are 3 toggle modes. > > >=20 > > > Two involve the notion of "enabled" outputs that I assume this attrib= ute is > > > for: > > >=20 > > > 1. Toggling all enabled pins at the same time using a software trigger > > > (global toggle bit) > > > 2. Toggling all enabled pins at the same time using a hardware trigger > > > (TGP pin) and toggling pins > > > =20 > >=20 > > This is presumably the tricky one as that hardware toggle may not be in > > control of the host CPU. > > =20 > > > The third mode though looks like it uses the same toggle select > > > register for selecting A or B for each channel instead of enabling or > > > disabling each channel. > > >=20 > > > 3. Toggling all pins to A or B based on the toggle select register. No > > > notion of enabled pins here. > > >=20 > > > I haven't looked at the driver implementation, but it sounds like > > > out_voltageY_toggle_en and out_voltageY_symbol would be writing to the > > > same register in conflicting ways. So maybe we need yet another custom > > > attribute to select the currently active toggle mode? =20 > >=20 > > This one feels like it could be handled as a software optimisation over > > just changing the DAC value directly. =20 >=20 > Things may be slightly different in these devices. But for ltc2688 and AF= AIR, > the symbol attribute is about toggling between A and B through SW (not re= ally > enabling the mode). That interface will only pop up if there's no HW (PWM= for > example) toggle present. I can't remember if we discussed it at the time of that driver, but from a userspace interface point of view, for a single channel there wo= uld be little point in this. I guess the key is it simultaneously switches a bunch of channels. Perhaps we can make that clearer in the ABI docs (if it isn't already clear enough!) So a software interface does seem appropriate. There is a fun question of whether the toggle select is useful to software. That is picking which of A or B each output uses for next toggle. At first glance I don't think so, but I'm open to people suggesting why that might need a userspace interface. Superficially feels like anything that can be done with that interface can also be done keeping all channels toggling to A or all to B at one time and potentially a few more register writes. Jonathan