Received: by 2002:a05:7412:d024:b0:f9:90c9:de9f with SMTP id bd36csp78012rdb; Wed, 20 Dec 2023 06:49:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IH6TGp48nAiQOA3ztk/jspKDfCVVcoRwmU5QrRLrMm1aJEk+g98EZ56De9rz5LVriK2ILQI X-Received: by 2002:a05:6214:2486:b0:67f:3bd4:3770 with SMTP id gi6-20020a056214248600b0067f3bd43770mr5422894qvb.25.1703083754260; Wed, 20 Dec 2023 06:49:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703083754; cv=none; d=google.com; s=arc-20160816; b=v/ptog9+/6/v9NTGnvzW8grLLihQ6HudCuU1z5nqswSYdOHYKlBBFSncka2v0ZM3MX Ua7XS72q9trYhu/kz8p4D7unMX0APJu6ng/h2B6qzBw9rQ7oQdsTKej5DfjM3v1O9ql4 PFWy8NQe4FscjjQ5Og6X/4BBLp8aP5V1Y9LfgbX2K6HQHT5kAVwCBAiePvwj+Cu0g4gb PgyG2a1lcaSt8W1laYKGFIirPVgEf71px+h4HwWj2A0k/1AOQkNmh4tOjynZ8PucA24g du3bCUNiOd2BUC/c5qeWlXx5yYn9yfWx6e1yIt9NNn8LVRzttuR8j4zBk3Ef8FEpSZdb feIw== 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=bsjxey2dsdW9zmtMgla8meoMUII8qPv4yfBUYp6WVRY=; fh=2nQBOaBKhnW+Uhdrbg+UgbquIOi0h7n5f/qQeD6NClQ=; b=kg6hMW94HhF4y5k+wAbwZpaUg0c351lrSfa6P4ffAHMbNL+79JhtiMZRMPreXlKea4 MR2rYno//2jpeUwYTY9aIF0x8nV8GfFBLwmNn4HOe7KKpBDtlV4D4rcjkcF0yRRUkM4R RsNFz6EqPw88aUGBX+g52xZ0Cq8QcUgrNNouOPMUvDz+a20nptSoiiHLgqj1g4b9MwLc k2XNADUpTrdCX1SQUvsbuZYHhfP9rwyVJ/vUIaX7UX0xoWxmdDHhZRRBhY3MobX6JCSp ct/+eGruuZt1nKmxlob4sDeYD2qs9hly+QzcNlVblF713e8flVcsR3/L4+BQ9uK6P645 aD9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cxWsQQdj; spf=pass (google.com: domain of linux-kernel+bounces-7082-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7082-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 i20-20020a0cf114000000b0067f6afc9215si2095906qvl.85.2023.12.20.06.49.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 06:49:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7082-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=cxWsQQdj; spf=pass (google.com: domain of linux-kernel+bounces-7082-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7082-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 080081C23C64 for ; Wed, 20 Dec 2023 14:49:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D5303D979; Wed, 20 Dec 2023 14:49:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cxWsQQdj" 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 4517B3D966; Wed, 20 Dec 2023 14:49:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7F5FC433C8; Wed, 20 Dec 2023 14:49:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703083744; bh=Zpqr2IduaIi/eJ/LAgUU9AcGnT1pYkcj9gSp3Y9liBQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cxWsQQdjxVAgGtLFajkjfRxEgGKU0IxwFKluuoVH+lIwLTGobBcQSdLuaxKRJQJYr tPXBZMkWos12ATD7kurnjiawElKvVNjngtlOkI9qF68mVExoym4AKyDstMSbaEJq9A sSQ1mcLeiaqJgJg801kSvb5adToVQtt9sAJMssLXzR+mYZ4aFXe5WQnSZt/vF6Y6/r PN0TI3kEZmmbJAk+L+K0sb8W6xvMV/9gPME+/YFkWLf3LzQZMxqTm4vnzPvEH2ZwwZ S/ASyHQS0LPmKoWE2K7jujnSJzEhsOYJIHmRqt9IGUMfFMDPPXRyiLZIYBlLMkhpwd VULPoB4hOcvlw== Date: Wed, 20 Dec 2023 14:48:49 +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 v4 2/2] iio: dac: driver for MCP4821 Message-ID: <20231220144849.0189a16a@jic23-huawei> In-Reply-To: <20231219090252.818754-2-anshulusr@gmail.com> References: <20231219090252.818754-1-anshulusr@gmail.com> <20231219090252.818754-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 Tue, 19 Dec 2023 14:32:51 +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,4: > - no updates Comments were on v2 from me.