Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1533740lqb; Sun, 26 May 2024 05:49:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV7nQMTMsn2YK760+8d4DItV5h4+wuOCSpplzfCrhbe9U5QiZijFS9wvM3y8DJ9P+FjQQVxJQCSbk2t49qXumMgaZDtn46DdbbUIqe3pw== X-Google-Smtp-Source: AGHT+IHj7jT61itnWFig7JTSZzmkUPNDe7bhgbpRdoKBiNxnflkxaekz4KI4otJU8HEVcT9iPGCi X-Received: by 2002:a50:a459:0:b0:578:56d8:8d59 with SMTP id 4fb4d7f45d1cf-57856d8934bmr4132101a12.20.1716727798534; Sun, 26 May 2024 05:49:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716727798; cv=pass; d=google.com; s=arc-20160816; b=jV+bU/JAY0hfyuiy78NtuzR/pi5kv0zpvb7doMivAVfbGVA+Dez3KR1VRRpleB3LCt 9QIsAnFn7lPSGVjgH0EO0rvMXbafcfXPJyVsMBtTMsX08UEN6TiOT/SBjW0bbGb/iZuH A0eLp8iANQJ1m8QuX4UyIBSjzsWCulYkzdjTQkuzL07eA5M82RdughVsZeUKIAEFQkE8 CIc20ZSrOjPq7hwLdWjXjoFBD1iiYDCOCITVeWKgy3tZKWXAmuX7mYTsxdLMlIPKNV8z Sjswwp+14pP5fhQ+vb++aD/BdZ8Waikfv3hkGIB+fq4M8WMKs3agKnaTSnL5vkh+bZcp 8E1A== ARC-Message-Signature: i=2; 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=Ao88PQEiSM2AEdTcWzLBtqDHtjnFGGRfDrMR0PtclzA=; fh=eaEhmM2PxTEYnGm8TRDKeB5MnetL7ogCkw/reKY1rgA=; b=krlMG3Y19lXtzsVmJIjUF+bwPNuUm07VEB8myK0sSBK9sfZB/acHaFbsLkZc6mz0FA 1Kn6Z2tI+pgtx+eKCbni9YkWoo+eB3It3ih/qLIwxQ6bw/vuvvYsmIE6QlVniXGnZrDy awD009WNfxpLmjZAjj6jlPRzCTjgno1AoMgSTYjDf2gNYMZtRzhxY15nvkMQ81trDn24 HKI6+9uJBLxmbvQ1SGUx2rAPDOL/8HRvPFAj7Dav6uaJ8ljQmcXvZWhgK51xoqtoWjnl 3rEbmoqdD6utyXOuZIDB4I86thqleIquJ3gBTGP7WtUI5dx49nJDAhjCd7YaV6PGMe4a 5LRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AalhAbx2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-189740-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189740-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-579c83ae25asi841032a12.555.2024.05.26.05.49.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 May 2024 05:49:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-189740-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AalhAbx2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-189740-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189740-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 460D31F212E9 for ; Sun, 26 May 2024 12:49:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C0933F9DF; Sun, 26 May 2024 12:49:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AalhAbx2" 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 D47E6DF60; Sun, 26 May 2024 12:49:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716727790; cv=none; b=DethIk9Bm4h7Hu6Xffv5j7jicpCBM099BiTnt5gsOeMsjNn+kZYOjbDEOMBkAZDjO98rO5LM9sNnzfO9PTPOprwib/e3qvONqpQuTOxx7yR9PKvl9gdEvho0ciygsVdZrQrxklQ+bs+EHXzurX3CSH1jLZ0uUCXS+/WNFkniFmQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716727790; c=relaxed/simple; bh=mRfq0TFYrIwU/YNjg/1gxs3DAKBxoubVD2/h3CYP9is=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dUrq89NdE6DbcavMWaS7go7wyS3llhDYdeAutXaE0YCSbOyCinVKCikJYRY+UTsvYwbm+eGO+rSaDZ3WV+0y+GSpadI+QWlkO2YhkkBhCIEoKa/5gNjSV4fZdSxNgwG/xo42+BGiYHd3b5eleJRcKYb75qFjbpX9Fz0WehPZk8M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AalhAbx2; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35AC7C2BD10; Sun, 26 May 2024 12:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716727789; bh=mRfq0TFYrIwU/YNjg/1gxs3DAKBxoubVD2/h3CYP9is=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=AalhAbx2ZcTiAzrA5IXdrKWE1cxH5oMw53Axo95u5hSQn0PuLWR24BSeAzjVeuAZe 5NsDqbglZYFjQtvG04xa6W4pe6yGp5lS8rEauGnlXSh8uiXvQANOolPbdBErtTTBxn /JFJ5cUIbB7ZVrMw8FzWHmuNyvVkKLyonoGP/gmpL8x9DOpegAyccQ9WtTOPTiYXpj uO0/0dWe0vKcrzfWF14iVbH1x//5BEWt6VKMVAj4TsChujxzlMaWSc0dcEl1VPxtMy IBznp/UOefU9buH+udd+aeprbOmcAF1i+PnWbHuHc9LRx3RlH4aqMYJMuBStsizfuK vgCLPR5v9n8Vw== Date: Sun, 26 May 2024 13:48:58 +0100 From: Jonathan Cameron To: Nuno =?UTF-8?B?U8Oh?= Cc: Ramona Gradinariu , linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robh@kernel.org, nuno.sa@analog.com Subject: Re: [PATCH v4 10/10] drivers: iio: imu: Add support for adis1657x family Message-ID: <20240526134858.636d2c8f@jic23-huawei> In-Reply-To: References: <20240524090329.340810-1-ramona.bolboaca13@gmail.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.42; 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=UTF-8 Content-Transfer-Encoding: quoted-printable > > @@ -1500,7 +1973,10 @@ static int adis16475_probe(struct spi_device *sp= i) > > =C2=A0 indio_dev->name =3D st->info->name; > > =C2=A0 indio_dev->channels =3D st->info->channels; > > =C2=A0 indio_dev->num_channels =3D st->info->num_channels; > > - indio_dev->info =3D &adis16475_info; > > + if (st->adis.data->has_fifo) > > + indio_dev->info =3D &adis16575_info; > > + else > > + indio_dev->info =3D &adis16475_info; > > =C2=A0 indio_dev->modes =3D INDIO_DIRECT_MODE; > >=20 > > =C2=A0 ret =3D __adis_initial_startup(&st->adis); > > @@ -1515,10 +1991,25 @@ static int adis16475_probe(struct spi_device *s= pi) > > =C2=A0 if (ret) > > =C2=A0 return ret; > >=20 > > - ret =3D devm_adis_setup_buffer_and_trigger(&st->adis, indio_dev, > > - adis16475_trigger_handler); > > - if (ret) > > - return ret; > > + if (st->adis.data->has_fifo) { > > + ret =3D devm_adis_setup_buffer_and_trigger_with_attrs(&st->adis, > > indio_dev, > > + =C2=A0=C2=A0=C2=A0 > > adis16475_trigger_handler_with_fifo, > > + =C2=A0=C2=A0=C2=A0 > > &adis16475_buffer_ops, > > + =C2=A0=C2=A0=C2=A0 > > adis16475_fifo_attributes); > > + if (ret) > > + return ret; > > + > > + /* Update overflow behavior to always overwrite the oldest sample. > > */ > > + ret =3D adis_update_bits(&st->adis, ADIS16475_REG_FIFO_CTRL, > > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ADIS16575_OVERFLOW_MASK, > > (u16)ADIS16575_OVERWRITE_OLDEST); =20 >=20 > Slight preference for local variable to avoid the cast. Hmm. This is a symptom of adis_update_bits() being 'too clever'. I'd be tempted to just split that into 16 bit and 32 bit versions but that is a much larger patch so a local variable is ok if ugly. >=20 > - Nuno S=C3=A1 >=20 >=20