Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp975760rdf; Wed, 22 Nov 2023 02:03:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IE02fpko5c0a2a7k2btFqbHNA15YSmCQjxgJdbW648viTZgJNddOgT2hPSTDc8Uqmr3LLTy X-Received: by 2002:a05:6a00:3927:b0:6c6:aaa4:5d68 with SMTP id fh39-20020a056a00392700b006c6aaa45d68mr1790293pfb.27.1700647391703; Wed, 22 Nov 2023 02:03:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700647391; cv=none; d=google.com; s=arc-20160816; b=R6wbMRTzzjIDAfCRVY5QP6JNaOvS4hyddl+sbGhUeFy1u0pwS2+zNbQwdLebTtWGyl Qce9YRD5KWlBDk+zWhjeuBxguGA4ORwOChXLq0IrbrbF5LsOyjeaPa8IBRokJ3BY4ctu EeaIZu+THHI7j6DJmmpW0QSAWXJ6HLFS+VgqsLFjXc0TelfYEQrL+v4KmW5nE2FohXKo t7BUnvqNsQWRX++eLJJrvZPusRoT+XkJCkVt2ECP4rVUW4+lSYaA9SHQp0J/kp9j1pE8 YMDSIAx6M33MZ9U/zdFycUJMDuh4v4si8dRN+T1x7Zo0dW2zHqvR8CdpkJkPOrOgo9bp wj3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=WhiYfLET0RbSH/anHfFxSPRW55ur2nAPEIxF6Td7rmU=; fh=PUkfsyee365CVQzcLdwpKasMEgo/GQux0tzjfi3T/74=; b=0edKwdZY/JFk9WKJWPar4HtcSX7HC1ESSclwrBPP2CLuoT5SGaEDf2T4adYTw3nqvm ALxqGUN/XyKcU0Uw0YzpHoeG/X099aLx1pxc/Q0n6xwuFA7briAr0Bk3uRZCGrpc4hXB CkRPlN29X7BGr4zS5Lih2d3wMH/0piRblivoJ8LJ7hzOyt6vRVct+xg4YKb4TNSstEB5 WbiLK5XgRyOL8KGK5DDCilErutCWrsWNcJYzRKhSGPYSD58uicChBhqAEDYjLSvgU9+A tZIHKZnnsdJhnCOboN/wcmes5yIZy8+vHK42UrQfvBz4MebJXspdW3XJWsP668c+p9qb V28g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YuqQ5y4Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id f21-20020aa79695000000b006c320a95e8esi11695409pfk.404.2023.11.22.02.03.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 02:03:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YuqQ5y4Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4A31E809789E; Wed, 22 Nov 2023 02:02:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235067AbjKVKB5 (ORCPT + 99 others); Wed, 22 Nov 2023 05:01:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229631AbjKVKB4 (ORCPT ); Wed, 22 Nov 2023 05:01:56 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EA6093 for ; Wed, 22 Nov 2023 02:01:52 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 478ADC433C7; Wed, 22 Nov 2023 10:01:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700647312; bh=16th6QDMJEjq6KILhAnwcfDH2x8BSn+uvdX9T2br+R8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=YuqQ5y4ZH+oy4dVC9gpOGZ/ksV8omrnWIrx0K/YwWBjRRHvR3V08GjZH+kux24vkt D8j08Dhl2DNS1thdGgLKgCj0m6MCIxgqbFvAICTLb8o7SP6f9bG1gx3Kdlq9mvmb79 c0QOqqu3istOaYIDOGnQAwkoUhhnyAiWf8+tTq1Gwa+kK/Q/NfN7FK54CVrWLivS1g U6uqZutVJQx7PaVYwF7Rggo6FdrJ/IY39jlOOWBb8oY4jne+dsmgZz+2VUzCus7Skr DgJxyDKOwy8faQ7/k+n3mZzdn2VOamWqqYjPhQ6dyEhlUvbIa5aWmyk1EHrj6FmEus o30Ien+4wcpAg== Message-ID: Date: Wed, 22 Nov 2023 11:01:45 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 6/7] iio: adc: Add support for AD7091R-8 Content-Language: en-US To: marcelo.schmitt@analog.com, beniamin.bia@analog.com, paul.cercueil@analog.com, Michael.Hennerich@analog.com, lars@metafoo.de, jic23@kernel.org, marcelo.schmitt1@gmail.com Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <514295a9b760b44a710425803a41decddd3e8df8.1700595310.git.marcelo.schmitt1@gmail.com> From: Krzysztof Kozlowski Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4B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Y+NaFahT0lRPjYtrTa1v3tem/ JoFzZ4B0p27K+qQCF2R96hVvuEyjzBmdq2esyE6zIqftdo4MOJho8uctOiWbwNNq2U9pPWmu 4vXVFBYIGmpyNPYzRm0QPwARAQABwsF8BBgBCgAmAhsMFiEEm9B+DgxR+NWWd7dUG5NDfTtB YpsFAmA872oFCRRflLYACgkQG5NDfTtBYpvScw/9GrqBrVLuJoJ52qBBKUBDo4E+5fU1bjt0 Gv0nh/hNJuecuRY6aemU6HOPNc2t8QHMSvwbSF+Vp9ZkOvrM36yUOufctoqON+wXrliEY0J4 ksR89ZILRRAold9Mh0YDqEJc1HmuxYLJ7lnbLYH1oui8bLbMBM8S2Uo9RKqV2GROLi44enVt vdrDvo+CxKj2K+d4cleCNiz5qbTxPUW/cgkwG0lJc4I4sso7l4XMDKn95c7JtNsuzqKvhEVS oic5by3fbUnuI0cemeizF4QdtX2uQxrP7RwHFBd+YUia7zCcz0//rv6FZmAxWZGy5arNl6Vm lQqNo7/Poh8WWfRS+xegBxc6hBXahpyUKphAKYkah+m+I0QToCfnGKnPqyYIMDEHCS/RfqA5 t8F+O56+oyLBAeWX7XcmyM6TGeVfb+OZVMJnZzK0s2VYAuI0Rl87FBFYgULdgqKV7R7WHzwD uZwJCLykjad45hsWcOGk3OcaAGQS6NDlfhM6O9aYNwGL6tGt/6BkRikNOs7VDEa4/HlbaSJo 7FgndGw1kWmkeL6oQh7wBvYll2buKod4qYntmNKEicoHGU+x91Gcan8mCoqhJkbqrL7+nXG2 5Q/GS5M9RFWS+nYyJh+c3OcfKqVcZQNANItt7+ULzdNJuhvTRRdC3g9hmCEuNSr+CLMdnRBY fv0= In-Reply-To: <514295a9b760b44a710425803a41decddd3e8df8.1700595310.git.marcelo.schmitt1@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 22 Nov 2023 02:02:00 -0800 (PST) On 21/11/2023 22:36, marcelo.schmitt@analog.com wrote: > From: Marcelo Schmitt > > Add support for Analog Devices AD7091R-2, AD7091R-4, and AD7091R-8 > low power 12-Bit SAR ADCs. > Extend ad7091r-base driver so it can be used by AD7091R-8 drivers. > > Signed-off-by: Marcelo Schmitt > --- > > Device read/write might look odd due to the transfer protocol for these devices. > I'm glad to hear any suggestions on how to make it better. > ... > + > +static int ad7091r8_gpio_setup(struct ad7091r_state *st) > +{ > + st->convst_gpio = devm_gpiod_get(st->dev, "adi,conversion-start", > + GPIOD_OUT_LOW); > + if (IS_ERR(st->convst_gpio)) > + return dev_err_probe(st->dev, PTR_ERR(st->convst_gpio), > + "Error getting convst GPIO: %ld\n", > + PTR_ERR(st->convst_gpio)); Don't print error code twice. > + > + st->reset_gpio = devm_gpiod_get_optional(st->dev, "reset", > + GPIOD_OUT_HIGH); > + if (IS_ERR(st->reset_gpio)) > + return PTR_ERR(st->reset_gpio); > + > + if (st->reset_gpio) { > + fsleep(20); > + gpiod_set_value_cansleep(st->reset_gpio, 0); > + } > + > + return 0; > +} > + > +static int ad7091r8_spi_probe(struct spi_device *spi) > +{ > + const struct ad7091r_chip_info *chip_info; > + struct ad7091r_state *st; > + struct iio_dev *iio_dev; > + struct regmap *map; > + int ret; > + > + chip_info = spi_get_device_match_data(spi); > + if (!chip_info) > + return -EINVAL; > + > + iio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); > + if (!iio_dev) > + return -ENOMEM; > + > + st = iio_priv(iio_dev); > + st->dev = &spi->dev; > + > + map = devm_regmap_init(&spi->dev, &ad7091r8_regmap_bus, st, > + &ad7091r_spi_regmap_config[chip_info->type]); > + > + if (IS_ERR(map)) > + return dev_err_probe(&spi->dev, PTR_ERR(map), > + "Error initializing spi regmap: %ld\n", > + PTR_ERR(map)); Don't print error code twice. Best regards, Krzysztof