From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f52.google.com (mail-oa1-f52.google.com [209.85.160.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 0B8961DF746 for ; Wed, 8 Jan 2025 21:16:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736370986; cv=none; b=i9y1f9v9AlGIDJbdNcROysPLh5bbOvwrF7c8OperbJnWZjHdrUF4Xe9WVbUvLbOtQgYKnHGzIuzjLnSx7XzHAqiF1N7f+JMhlUgzVGwsUlQsXok69bRZ3hBqhv2ZOuEwcvuU99y/4N20TRaxP/gef4nGcPzZ+JcmA1RmPxRLV2U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736370986; c=relaxed/simple; bh=HB1NJQDRLX0WEL8mnldgAc5QZZplXpVSWEQYwANwTl0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=uCTAMDCrBth5OKzIKDm9DM9CGveOqxHjBFMNZqfqM8MYV5gv6Lh1RDqSybmJK5Vty5qlArOTwPcuC4I6OvPpVyesb5OaBkhOlXBxa9pvvV8aMq0TB+CQ2gtPnlwwiUJK7ehzcAtp3TSO27XWMie5OCoCc70Jk1F52YLHiEq6Lko= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=VAHOyRGW; arc=none smtp.client-ip=209.85.160.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="VAHOyRGW" Received: by mail-oa1-f52.google.com with SMTP id 586e51a60fabf-29f88004a92so156694fac.1 for ; Wed, 08 Jan 2025 13:16:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1736370982; x=1736975782; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=LVM62qWNY3HcZseHT9G2aNl4yPSR5DOCQCsjQBmWcYg=; b=VAHOyRGWQ1EOSrTlWGaKULtZYDw4zgvy2VhWWUHM5jP6gfrK1iRC6WPm2YldIJKd84 xtOf2poh3KTa46ICeAko8L5vvR+foJgqvispVUWckqxSngniLB0Iesf/5PKDOuHI+oAb CHXz1vhnpdAtdUOqO/YH4Li8RTi9yrQse0ggsjrnPY/5PQwMWlWCe4SuXlL2FPqYosPY QRoii11VMacDDccmKs3nEVUHVNCIaSmQX9g2Z72lweXA5XaCwe4xKFeHFrX5vIVSEARS AF3yLsdA5FOutD3vAo+SsHJjQz5DEtT7WsyLFr2ygEHVKQ1mJTT2LYDghokJ+uG1AYc/ WkfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736370982; x=1736975782; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LVM62qWNY3HcZseHT9G2aNl4yPSR5DOCQCsjQBmWcYg=; b=mUWkJfThXa6xrhQV3oeqfiBZVf9brfa977cuDdRgRHSf3mVMVFugKDHpt0r+Q2hqDM C4NZEEWPp4lNFEt70eFtMwm/WsAo/OGvFJo6nPVpdb8KmZ7IJnL6weJZ+klNRWh6TGlC rNrPRY9iLplCSfU26nGiBMrif21uV+VcpJIqxLsGPCz+4HFrlhQFZP3nijvvLgUe2DrQ oK+Zz3Gb5UMAUDLM0+6xG+QLsa4V7DAG5hBU4rgjY9mQti2GRxtimkiuFXUbw3Ov9+lk h+xTCbL/dX454+Vou6lbP0h3cDg3XVP4WU75fOrL8+9AWA2Gr2x5s8CjlBKMA5dVOxXg t6Ig== X-Forwarded-Encrypted: i=1; AJvYcCX9W26t983h4AEU6xbs+3nyj7LEBHPdW6ChqmEmJyujgwIhHCNxM/IHp4447IfZ/4/RteansjUiN07hdck=@vger.kernel.org X-Gm-Message-State: AOJu0Ywcds3Cfc1wBeRaQSTdpImqbfPpjopkvekswv8ueetIB0OeOUGC PMnJB8FDnwVbwOIVtaafliyP9mTmiC8myjSyMPWYut8iSOe8Wp5xrmiWu/Pqcvo+IGijF6YUQL8 q X-Gm-Gg: ASbGncucwloof+aR2A6aI2IbB+Xf0d3eGZofDr4Oo/kVGZnpAlgv0eYqMUjGTRouOBp ++TgXEPHxxK9qvUOAMZ5YRIWXLCYm+XOmxh+HB3b4prSl9UYEGiSGWAESTJQYBuV5drZZx+BuPw v3qe/Xg8iwUhWIQJrVhp6olIYHBzQI+cvBwao95/xDYfr8GaaW97x30nKfWR8ZU0JsmhSAkii53 v8tQNkkmClQnnGoT2Qy6x3uml9DCIvfSK+T5cNQJi7xKABCb25ZaozwYs3IEIk36X9o7+0M2O4S +K3U73B+7u0bRubS3g== X-Google-Smtp-Source: AGHT+IEmMxvKWJMOeR4+uH7/l+J4PhqThes0jhsV2r0+OgTq2c/ITTmo9FseDL8fxRugjRcrvmQOrw== X-Received: by 2002:a05:6870:ce03:b0:296:e10f:af14 with SMTP id 586e51a60fabf-2aa06a052dcmr2009298fac.39.1736370982161; Wed, 08 Jan 2025 13:16:22 -0800 (PST) Received: from [192.168.0.142] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2a7d77f3bd3sm13646713fac.49.2025.01.08.13.16.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jan 2025 13:16:21 -0800 (PST) Message-ID: <80fa8faf-b5ac-4f3e-84b9-acf8ac6ab26d@baylibre.com> Date: Wed, 8 Jan 2025 15:16:21 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 6/9] iio: dac: ad3552r-hs: use instruction mode for configuration To: Angelo Dureghello , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Mihail Chindris , Nuno Sa Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <20250108-wip-bl-ad3552r-axi-v0-iio-testing-carlos-v2-0-2dac02f04638@baylibre.com> <20250108-wip-bl-ad3552r-axi-v0-iio-testing-carlos-v2-6-2dac02f04638@baylibre.com> From: David Lechner Content-Language: en-US In-Reply-To: <20250108-wip-bl-ad3552r-axi-v0-iio-testing-carlos-v2-6-2dac02f04638@baylibre.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/8/25 11:29 AM, Angelo Dureghello wrote: > From: Angelo Dureghello > > Use "instruction" mode over initial configuration and all other > non-streaming operations. > > DAC boots in streaming mode as default, and the driver is not > changing this mode. > > Instruction r/w is still working becouse instruction is processed s/becouse/because/ > from the DAC after chip select is deasserted, this works until > loop mode is 0 or greater than the instruction size. > > All initial operations should be more safely done in instruction > mode, a mode provided for this. I'm not sure it is really "safer". The way I read the datasheet, this just enables bulk reads of multiple registers. So unless we need to do bulk reads it seems like this is just adding extra complexity to the driver without a tangible benefit. > > Signed-off-by: Angelo Dureghello > --- > drivers/iio/dac/ad3552r-hs.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/drivers/iio/dac/ad3552r-hs.c b/drivers/iio/dac/ad3552r-hs.c > index 27949f207d42..991b11702273 100644 > --- a/drivers/iio/dac/ad3552r-hs.c > +++ b/drivers/iio/dac/ad3552r-hs.c > @@ -132,6 +132,13 @@ static int ad3552r_hs_buffer_postenable(struct iio_dev *indio_dev) > return -EINVAL; > } > > + /* Primary region access, set streaming mode (now in SPI + SDR). */ > + ret = ad3552r_qspi_update_reg_bits(st, > + AD3552R_REG_ADDR_INTERFACE_CONFIG_B, > + AD3552R_MASK_SINGLE_INST, 0, 1); Missing undoing this operation in the error path if a later operation in this function fails? > + if (ret) > + return ret; > + > ret = st->data->bus_reg_write(st->back, AD3552R_REG_ADDR_STREAM_MODE, > loop_len, 1); > if (ret)