From nobody Fri Dec 19 20:58:28 2025 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.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 6B0BC201016 for ; Wed, 8 Jan 2025 17:30:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736357438; cv=none; b=VifwVNZpFcacBzWd6TAGZ4t7WaQTydIUYBMZnES/4f6CIFevgFyXfCe3wxXp8osapAyJWsxcgcbzaTl4e9L9eTcI4RgiqBHLlqOvixivoqKIk0fr/mzvWVeNj9FaOukiYVWvm8g4XS6GRd/z6ERs6Yi9C1gazC6yJ8hs+ISfmqk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736357438; c=relaxed/simple; bh=+lZHZ4OM8rTY/dhezSlahZGVnk6ol0FvguLhf0YmUqs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Bn/u48SfzYccrYE6GhB2lZKTjYl9QjdBCIwpRH3YwWLJIycOUUBdLEq5nVAzs7a0ZloIsW60dSNPTV3IgdSbrJgbfXzS0n4wVFR3c1ppY0xIWwJq/LiiVvdir6QUBH7AhSjJSzBIB6ohZW23ROHpyn+ntWCmWUT2eubrouPWcd8= 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=QB8ttpc9; arc=none smtp.client-ip=209.85.221.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="QB8ttpc9" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-38a8b17d7a7so7651f8f.2 for ; Wed, 08 Jan 2025 09:30:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1736357435; x=1736962235; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=xfrMkIY9tbM1sPwHCNYu/jKLHOMpHgwU9OMNQ7g5My0=; b=QB8ttpc9lu5kIPW9y5IGzWfWIaxC4JQzHb63R6JpfCAEKIGO6c4DvBWKYnY5biJ+aq NSlFi54pPO6YZg7HqLGrHTASLkab6A/hW+YgCGX8MpGr2jk42nKwdFbDpUhughsl2pfT yAOdypOo2JPocecoo9FhJWUU+2sDvEKfAUCZLKYZa1NjaFPRItvRouJhuzS12s06jQpq +WyUAfWzFKhLGTdw3+TFKIWlGmVLe+wn0VxIIILYjopzaswt1SGUpRl6hhGAq0jBuIso 97hSfVc75ensKGDGJoP4lROmgaC4Tuv5rGhjZOUkCTZXHfCwSz61Xx8/3qX1zGilPQK7 E1/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736357435; x=1736962235; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xfrMkIY9tbM1sPwHCNYu/jKLHOMpHgwU9OMNQ7g5My0=; b=l79IKuUJ2I/A3sjKYjLLtqc2uiCHAfrQKrttgChoJdwLgovPNE2+1u1yVEMIgdb1/B VsRbnKj2gx0qtu0kwcos0Ry+68Ix6zq4GQquVPtVUEXoQ4xhlenE35c2Au2/HfG6T2Rm WsC3m1mSamtH4W7Jx8Hoo0+cOwN7oE3SKz/acqHVu7FsNAB9tdOG1oamlgA10QVghNN8 gjKSeoOuH/iDpgk1Cb66OW3WcKyLsRqgMosS88yqLysJt+UQ+8V6Hzz7nEWqgvwfTIXz g/4JBhgm5cuNcl7gBe1F0ajmitkEnMHjLWBzFSmdQBlHWbvk3vVR++xE4wi9wu6ME7QE tHjw== X-Forwarded-Encrypted: i=1; AJvYcCUikWS7snwhBOSq/Y+o4vzBvbFmaQpiIkrw5ObRPkFIrIgTNPmNIVLTuW2l5ErK5XipLCiwbIdh4n8UXGU=@vger.kernel.org X-Gm-Message-State: AOJu0Yzrcc/vMFnUdr/eU1l+aXBNXZvTaf01J+GKFzaRlPiZmkIZbWRZ hlq89nBcVP8YorGAPViTlGRgkcSfbc6w6zBzkoiZ7zHK38pJoGJf8nVCc8uf8Qw= X-Gm-Gg: ASbGncvM+fUgy7nq76ScahDnllGMzbcuzKKxjZDK1nRPLUxrc/KwBwgF+ODELG6Vv9L 7QOXqbNrVv+kmbf4A2wIMR6XoEo50ZHBi4NomFMtkgo5TiJFjHf8NTJmj2I2Fne9FkuFPIsSaSe /KCrfzc0uuY+TpubXNzgGExr/2J2erWnRv8sGyEo/I8LeqnLqFO9BEtN5PUTvBqfkXUueeK0flt 8DY4x17zFOg/VP3ne8QuvJeOw7lHM6CkyvSKkffLIHCF0iiNY+gr3b/CB0= X-Google-Smtp-Source: AGHT+IH4qbFI51oPuAFstB6iigZ7tk+yDzWm7fy62GK+mJysZx+iajrKN/1HnJeyNn4/bidfamGMWw== X-Received: by 2002:a05:6000:1f8d:b0:385:f6c7:90c6 with SMTP id ffacd0b85a97d-38a8730687emr3515425f8f.20.1736357434494; Wed, 08 Jan 2025 09:30:34 -0800 (PST) Received: from [127.0.1.1] ([87.13.70.66]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c8330d4sm52782599f8f.29.2025.01.08.09.30.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 09:30:33 -0800 (PST) From: Angelo Dureghello X-Google-Original-From: Angelo Dureghello Date: Wed, 08 Jan 2025 18:29:17 +0100 Subject: [PATCH v2 3/9] iio: dac: adi-axi-dac: modify stream enable 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 Message-Id: <20250108-wip-bl-ad3552r-axi-v0-iio-testing-carlos-v2-3-2dac02f04638@baylibre.com> References: <20250108-wip-bl-ad3552r-axi-v0-iio-testing-carlos-v2-0-2dac02f04638@baylibre.com> In-Reply-To: <20250108-wip-bl-ad3552r-axi-v0-iio-testing-carlos-v2-0-2dac02f04638@baylibre.com> To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Mihail Chindris , Nuno Sa , David Lechner Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Angelo Dureghello X-Mailer: b4 0.14.1 From: Angelo Dureghello Change suggested from the AXI HDL team, modify the function axi_dac_data_stream_enable() to check for interface busy, to avoid possible issues when starting the stream. Fixes: e61d7178429a ("iio: dac: adi-axi-dac: extend features") Signed-off-by: Angelo Dureghello --- drivers/iio/dac/adi-axi-dac.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/iio/dac/adi-axi-dac.c b/drivers/iio/dac/adi-axi-dac.c index b143f7ed6847..d02eb535b648 100644 --- a/drivers/iio/dac/adi-axi-dac.c +++ b/drivers/iio/dac/adi-axi-dac.c @@ -585,6 +585,17 @@ static int axi_dac_ddr_disable(struct iio_backend *bac= k) static int axi_dac_data_stream_enable(struct iio_backend *back) { struct axi_dac_state *st =3D iio_backend_get_priv(back); + int ret, val; + + ret =3D regmap_read_poll_timeout(st->regmap, + AXI_DAC_UI_STATUS_REG, val, + FIELD_GET(AXI_DAC_UI_STATUS_IF_BUSY, val) =3D=3D 0, + 10, 100 * KILO); + if (ret) { + if (ret =3D=3D -ETIMEDOUT) + dev_err(st->dev, "AXI read timeout\n"); + return ret; + } =20 return regmap_set_bits(st->regmap, AXI_DAC_CUSTOM_CTRL_REG, AXI_DAC_CUSTOM_CTRL_STREAM_ENABLE); --=20 2.47.0