Received: by 2002:a05:7412:d024:b0:f9:90c9:de9f with SMTP id bd36csp64186rdb; Wed, 20 Dec 2023 06:27:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IGofZkg8AoDLxabBzPqSeLYk0b1y8hy1wLx44osx5zS8WLxCHayxz1dnkGUk6mDJsIKKHk8 X-Received: by 2002:a05:620a:63c4:b0:77f:13f5:543c with SMTP id pw4-20020a05620a63c400b0077f13f5543cmr24440977qkn.73.1703082424490; Wed, 20 Dec 2023 06:27:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703082424; cv=none; d=google.com; s=arc-20160816; b=BaphmYAPmIoLPTfNBH91S6lAnuxXtSMxoi0NbwU7hkWacAarU6KYVk8uXgggnCx3lT FFU1AMhptCUE3kY4ijeJgwgcgKxjA6Ij2AxuQ7Hk9ohWuicU7dLKSaBF4JT+4pmytXWl Efsb8DhxteVnddFL4Dgl6pAp04SKSFU6uGVXO0eurVcC+RtKjnSiDkNtMwKgA/EsSFTz wlpfM7l1K05ADxRxM7LxXYIqK8ICtKhulzbcs9r2V0lCxZfn1LRw+wT68lIUyzjBNN4g Sa8jQ27VBKQkCuOEXwTfKjGKXEEB8A1jhVVjktd4GxKsll1O9OaBPgMzqRQg7M4eXozy zqeg== ARC-Message-Signature: i=1; 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=zr5rQmXHr+1dqXxp1r1Ik+Ov+JSdXHKQUqKta9LP50k=; fh=2nQBOaBKhnW+Uhdrbg+UgbquIOi0h7n5f/qQeD6NClQ=; b=ZbI8DeLIWMoSNObP1Bq8yHa/aJJO7c4WG5CPIDd36GLlYIFEK0pdotQhD+eqcYU9vu gO/2oSPZoWxlVvFSdXnSi9m2P+8oOqGiUEYI3lNFaKn7NIonF3sGOOndZFC3PuuScIXX kFQd4BBhUsF+EuMcUN+unOZ0KkYyP3uj+Je8aambNAC3KGMwPtGHY3bAd5gXVeDym7Zz Vwvu9SvHEv128PQsPQ0aR/VWmNsLqCAJOk8YFSwH1Bs0RkqLg/xGvEiGRcl/G+UthC1m GZtSyKnu1bqc2dg+78Wq15wX9GMVJqqq8lLx16E8Mn/SzT/Ud379irj3FjAB5wNP34sI 8UuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lME0Uujr; spf=pass (google.com: domain of linux-kernel+bounces-7058-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7058-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 m16-20020a05620a291000b0077892f61ac1si19149730qkp.616.2023.12.20.06.27.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 06:27:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7058-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=lME0Uujr; spf=pass (google.com: domain of linux-kernel+bounces-7058-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7058-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 408141C22B39 for ; Wed, 20 Dec 2023 14:27:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 75C5C38FA2; Wed, 20 Dec 2023 14:26:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lME0Uujr" X-Original-To: linux-kernel@vger.kernel.org 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 A577938F82; Wed, 20 Dec 2023 14:26:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46C9BC433C7; Wed, 20 Dec 2023 14:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703082414; bh=ACSAlCfkl6Oembs96AIka+WCm/EX8xaNKzVQV9k6Pgk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=lME0Uujr7IM1G7b832SNrxZn18Q9EY0WAkvH4/aZq74jJNTpCH3Sde26A6MBnScZU q7h0NsgVhA+Pdir/XPdD4lfhR8BuaPlwFDS2Gb9tSYY/l6Bco5D8frPQL2CtkRQWH/ bvqB7vG/uCOCtQN4soc/yxWUyJH5r/dsIcaypdv94EW9XCyOffxM9/GpYRgjWArxUc xDypCsQt50Yeh5VyUhCY4P4+IJyy+OqUIJevpAUMO/OTXImTZLtB2CvFVWKKk3sE+5 vdSmra5TM4UKRhy1frsuR9MQ6i02jx6WcceU2I7MDzmDXs7gE4IP+j02dMYSUv4f09 Qb6ZECqksBm/g== Date: Wed, 20 Dec 2023 14:26:38 +0000 From: Jonathan Cameron To: Anshul Dalal Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, Conor Dooley , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , linux-kernel-mentees@lists.linuxfoundation.org, Shuah Khan Subject: Re: [PATCH v3 2/2] iio: dac: driver for MCP4821 Message-ID: <20231220142638.7739c5d7@jic23-huawei> In-Reply-To: <20231218164735.787199-2-anshulusr@gmail.com> References: <20231218164735.787199-1-anshulusr@gmail.com> <20231218164735.787199-2-anshulusr@gmail.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.38; 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=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 18 Dec 2023 22:17:34 +0530 Anshul Dalal wrote: > Adds driver for the MCP48xx series of DACs. > > Device uses a simplex SPI channel. To set the value of an output channel, > a 16-bit data of following format must be written: > > Bit field | Description > 15 [MSB] | Channel selection bit > 0 -> Channel A > 1 -> Channel B > 13 | Output Gain Selection bit > 0 -> 2x Gain (Vref = 4.096V) > 1 -> 1x Gain (Vref = 2.048V) > 12 | Output Shutdown Control bit > 0 -> Shutdown the selected channel > 1 -> Active mode operation > 11-0 [LSB]| DAC Input Data bits > Value's big endian representation is taken as input for the > selected DAC channel. For devices with a resolution of less > than 12-bits, only the x most significant bits are considered > where x is the resolution of the device. > Reference: Page#22 [MCP48x2 Datasheet] > > Supported devices: > +---------+--------------+-------------+ > | Device | Resolution | Channels | > |---------|--------------|-------------| > | MCP4801 | 8-bit | 1 | > | MCP4802 | 8-bit | 2 | > | MCP4811 | 10-bit | 1 | > | MCP4812 | 10-bit | 2 | > | MCP4821 | 12-bit | 1 | > | MCP4822 | 12-bit | 2 | > +---------+--------------+-------------+ > > Devices tested: > MCP4821 [12-bit single channel] > MCP4802 [8-bit dual channel] > > Tested on Raspberry Pi Zero 2W > > Datasheet: https://ww1.microchip.com/downloads/en/DeviceDoc/22244B.pdf #MCP48x1 > Datasheet: https://ww1.microchip.com/downloads/en/DeviceDoc/20002249B.pdf #MCP48x2 > Signed-off-by: Anshul Dalal > > --- > > Changes for v3: > - no updates > Oops. I reviewed v2. Please find comments there. Jonathan