From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 19E14C3DA6E for ; Mon, 8 Jan 2024 16:59:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Lfh+jJuNP7F+7aZZBug9A21JYGXl+bYS4NP8ueBPqY8=; b=IkcHRH35AEhwJka9USIghCzHAY oJYLh3LxiLguI+QDq9OiAloEJ92KYOxEM1DlUe2ob0uUthO6EybPxpNnf4r2zivNJ9qfQWIIHMceA +SZLgfCIAcQrUCdCumXCDPapPcSS8o/2EV10h8oVx1YBjLzQZqWG2dhzuSOkOaKBjhoCZXmJEFHJM eoDRDrbc0DEAX1FutYvfdA2h4iAH8OPA2frgbcY2aw56kTxazDKcLxgEE0VkCCEHBRZpGWEVrEPDC oKPRi7zosQ2s6ViGmgEfPt7ICKqSOBjDEByrGBPT0h0JJa7H/uMIok59Lpn7KUvAo7QOKASKw4mgY 2ZMHs4yQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rMsy1-005hLC-1Q; Mon, 08 Jan 2024 16:59:13 +0000 Received: from mail-vs1-xe2e.google.com ([2607:f8b0:4864:20::e2e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rMsxy-005hKZ-1q for linux-arm-kernel@lists.infradead.org; Mon, 08 Jan 2024 16:59:11 +0000 Received: by mail-vs1-xe2e.google.com with SMTP id ada2fe7eead31-467ca2eb9ceso406088137.3 for ; Mon, 08 Jan 2024 08:59:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704733148; x=1705337948; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=9K38x+VLezLj6/jNgYnVJ1nMGYFk9RbvwFtSlmgAh8I=; b=I3z2m+O+A457cvjSB/p5c7WsKb6rAhAztTiCkIYW8MsiuSA2F/ePzkSt1Q54Dfphpw We6v9PAR5gl9DmnrTqBqvza52IcESHyVVoK6JowntsK5RTDTqEBXzPTaWJcLMLV2/Mmw zqZm/F82RmZQPRXMcBWpcJnNqszOqQS/DgBYLwGsKcDJVUwLgMHmcfF1C6FP+78akz1l M9En6X0qBTiyYvFmPJQVBbEPIzXdHyGhaNusjRhrjv9TDBdmA6WXXrC704hvJ+CsQ3bE 0d/i7ye60wab5pXaBRS7RgtA0UMt10pEzziq70g/2gc6XGXlzzlAM5CICDbJiayz/TRZ xhDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704733148; x=1705337948; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9K38x+VLezLj6/jNgYnVJ1nMGYFk9RbvwFtSlmgAh8I=; b=D6kx1bqDS1P/6AZ/LfPuB+YIk50g6DTS06GYS3NZ8U8TzCMGR0ghBsHd2lS3z4jIw2 pzoMZiu4TqhK/RKNO5nZN2eziZtON5GmpUmSYDC0fkdvrmKET3F0eok3XFSE5nG5T+6j FhPV3Z9tkFt+TQ+xU0qswUc/cKC9YgLy3Cq5SqoXjW1yhV8hEqHaqUyujrCndbVsEuNm 1qanak+I5voP3GWZdvFbg15x/i203ro5aE4En0qyPlZvJJPIrTqLALSe64oz20tzWFvK Zj1tDmljUvq0eq9lslCUIpCOdGZVBG4ea0llf57W51CbbVHaOefIUDvV0lhbRcGb6ey1 3udw== X-Gm-Message-State: AOJu0YywdHF9mnadG5g312pdzGptp1hJasNRFKCGRySVQAw+0ZdKGd9u QPOBbuH8LLh8ZmGLwhl8qHgB4qbRcyqzrA== X-Google-Smtp-Source: AGHT+IE/Qv668Ztj0QeHPWgPiCUb8oh1aEW8N4ltPdUoThdREI08DKfFatV4tJeLg/DwRn8524cBIg== X-Received: by 2002:a05:6102:3e90:b0:467:cd80:2608 with SMTP id m16-20020a0561023e9000b00467cd802608mr1476669vsv.11.1704733148039; Mon, 08 Jan 2024 08:59:08 -0800 (PST) Received: from ubuntu-server-vm-macos (072-189-067-006.res.spectrum.com. [72.189.67.6]) by smtp.gmail.com with ESMTPSA id hv14-20020a67e68e000000b004662865945asm30618vsb.7.2024.01.08.08.59.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 08:59:07 -0800 (PST) Date: Mon, 8 Jan 2024 16:59:05 +0000 From: William Breathitt Gray To: Fabrice Gasnier Cc: lee@kernel.org, alexandre.torgue@foss.st.com, linux-iio@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 06/10] counter: stm32-timer-cnt: add checks on quadrature encoder capability Message-ID: References: <20231220145726.640627-1-fabrice.gasnier@foss.st.com> <20231220145726.640627-7-fabrice.gasnier@foss.st.com> MIME-Version: 1.0 In-Reply-To: <20231220145726.640627-7-fabrice.gasnier@foss.st.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240108_085910_612536_8D5688C2 X-CRM114-Status: GOOD ( 23.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============3659542563054419912==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============3659542563054419912== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wjNWh2SLmyHjR/FO" Content-Disposition: inline --wjNWh2SLmyHjR/FO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 20, 2023 at 03:57:22PM +0100, Fabrice Gasnier wrote: > This is a precursor patch to support capture channels on all possible > channels and stm32 timer types. Original driver was intended to be used > only as quadrature encoder and simple counter on internal clock. >=20 > So, add a check on encoder capability, so the driver may be probed for > timer instances without encoder feature. This way, all timers may be used > as simple counter on internal clock, starting from here. >=20 > Encoder capability is retrieved by using the timer index (originally in > stm32-timer-trigger driver and dt-bindings). The need to keep backward > compatibility with existing device tree lead to parse aside trigger node. >=20 > Signed-off-by: Fabrice Gasnier > --- > Changes in v3: > - New patch split from: > "counter: stm32-timer-cnt: populate capture channels and check encoder" > - return -EOPNOTSUPP when encoder function isn't supported by the timer > instance. > --- > drivers/counter/stm32-timer-cnt.c | 55 +++++++++++++++++++++++++++++++ > 1 file changed, 55 insertions(+) >=20 > diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-ti= mer-cnt.c > index bf2726dd7f12..6933d42b16bf 100644 > --- a/drivers/counter/stm32-timer-cnt.c > +++ b/drivers/counter/stm32-timer-cnt.c > @@ -11,6 +11,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -38,6 +39,8 @@ struct stm32_timer_cnt { > u32 max_arr; > bool enabled; > struct stm32_timer_regs bak; > + bool has_encoder; > + u32 idx; This idx value is only used temporarily to determine whether the device has support for encoder mode. Do we really need to store it indefinitely here? > +static int stm32_timer_cnt_probe_encoder(struct platform_device *pdev, This function uses 'pdev' only to access 'dev'. It'll be better to pass a reference to 'dev' directly instead. William Breathitt Gray --wjNWh2SLmyHjR/FO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQSNN83d4NIlKPjon7a1SFbKvhIjKwUCZZwp2QAKCRC1SFbKvhIj K7S+AQCQM0asZnc8G7bJKzKJwkk/Jggj2YNluI1xFmJNzzWqQgD+I9Gx0gcX1sk5 8Cm4QXQFUMIu5YPYOyZsy0Yj0qaIKw4= =FdQj -----END PGP SIGNATURE----- --wjNWh2SLmyHjR/FO-- --===============3659542563054419912== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============3659542563054419912==--