Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3403269rdb; Sun, 10 Dec 2023 04:35:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJiEmWGpGuHYDKKpYJjmAv3LDp9TuGKAeIIKFYOVDqGQUDCHIOHsvgYsGWGN1TChZohhkG X-Received: by 2002:a05:6a00:990:b0:6cd:d53c:f5ea with SMTP id u16-20020a056a00099000b006cdd53cf5eamr3844090pfg.6.1702211755247; Sun, 10 Dec 2023 04:35:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702211755; cv=none; d=google.com; s=arc-20160816; b=aBzwxQA+NKURSdpDjXzFD6ai2Ob++zjMcNArupcD7XnMVY+cx5lJ8cXAQKeJCYQDvN vTsydX5jUC3zc5rMSpzIxPoFmKL3yK2fCxY1FabXyURwm/tWGTS3qlzYYwgeo+Qt8U5R 5VUCRdc0p5ryOcvJ41XCzERpBZToMbSMnDykid07It+SdtP4IEFRuyPf3LzpE9guG3g5 FLEGnBKfsngBX7GqsdajEbT1N9ewbdV+16+Z8tevTsnquaUnr/BZPqW+KQId+mEhfwB5 jD2JT7cZcP62546lxGNYZVMYjfnOHxfdaWioKWGCfFwoC4k+JcwBMKRM7VlE5C1+Kcm7 I7Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=iK8QL/faJwv2OYfzkOF8xuBT2RmbND/7lU6hP9iDqrA=; fh=WD/63rbd+kqN9ItFJmOtMPp0c5kgjUIaSO4QQPqWfy8=; b=F/fim3egzMv5ktLgGDBD+JJWGqUxuyUep4JphEiQj1FJOVhKJuajzNfZEFShFA06IS om80PltagvOL8ODks2uN66gKnpaK7ujzonq5uvQhmuVKzoOzZkde2nm1O/DDzruwcuX8 eotSyNVZnuTpZwTuZBVQr19XBXY33LXruI89YW1fFdwSey7I6E6fpNagFYC6aH1mbEv3 K3ltDNs7jFFIoSwZD0YYmkDBDsebv91c3Yl/m6GVOzSIrggoEcu8p20+1OD3kIkMCEL8 jWnsg8YqJLMvhaqxTllRH+YljCyPEMMTcw1QonOMuxkVMz7h3xZpADZym92TLoNBtCZK +uQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Dk7Bf/F0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id kr21-20020a056a004b5500b006ce4df26354si4571153pfb.56.2023.12.10.04.35.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 04:35:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Dk7Bf/F0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 43EC6808EECD; Sun, 10 Dec 2023 04:35:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232115AbjLJMfO (ORCPT + 99 others); Sun, 10 Dec 2023 07:35:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229584AbjLJMfN (ORCPT ); Sun, 10 Dec 2023 07:35:13 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E85F0102 for ; Sun, 10 Dec 2023 04:35:19 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87151C433C8; Sun, 10 Dec 2023 12:35:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702211719; bh=wsAE6AWIA0igK94XxcyNxUQ4idq7YVmNjP8oXu4ldBE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Dk7Bf/F0FPjamUqsmdINGYv1jpTQMb3J84BGqP9GbFw8/GoIVbY2jmsZWUvrNekV+ my00CTlHyxvF/26Ddqti/ysomiYGNsvVxzC9Epi7ZKxnJyoBnY5h+eYX/n6dHtVxdJ IiW9Ae8ZK3oCDZAGLOJ+SCkYoRmDyRi6BzdcIc+6PmwacoxL+0cjafOPmsY0Hkdoxh Y7vuLshAV7WIPd8KFSt8AaWg+htknRFg2HLl7HFg0BtGvy0odnmj4MAvinvqvmUb7W FBKHUq+wiY96wwD9Yg7KvahPlC6ECt85bU1Vflgw8eH65C4pPapIYsVtdwczKHpKEA +rF0aX6NWxk5Q== Date: Sun, 10 Dec 2023 12:35:11 +0000 From: Jonathan Cameron To: Marcelo Schmitt Cc: , , , , , , , , , , , , , , Subject: Re: [PATCH v3 07/13] iio: adc: ad7091r: Set device mode through chip_info callback Message-ID: <20231210123511.63ddd8b2@jic23-huawei> In-Reply-To: <84826948132ccd66b9a64617bc4eb2cbc9a3f90f.1701971344.git.marcelo.schmitt1@gmail.com> References: <84826948132ccd66b9a64617bc4eb2cbc9a3f90f.1701971344.git.marcelo.schmitt1@gmail.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Sun, 10 Dec 2023 04:35:27 -0800 (PST) On Thu, 7 Dec 2023 15:41:03 -0300 Marcelo Schmitt wrote: > AD7091R-5 devices have a few modes of operation (sample, command, > autocycle) which are set by writing to configuration register fields. > Follow up patches will add support for AD7091R-2/-4/-8 which don't have > those operation modes nor the register fields for setting them. > Make ad7091r_set_mode() a callback function of AD7091R chip_info struct > so the base driver can appropriately handle each design without having > to check which actual chip is connected. > > Signed-off-by: Marcelo Schmitt Hi Marcelo, > + > #define AD7091R_CHANNEL(idx, bits, ev, num_ev) { \ > .type = IIO_VOLTAGE, \ > .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ > @@ -52,6 +60,7 @@ struct ad7091r_chip_info { > unsigned int num_channels; > const struct iio_chan_spec *channels; > unsigned int vref_mV; > + int (*ad7091r_set_mode)(struct ad7091r_state *st, enum ad7091r_mode mode); Given it's embedded in a driver specific structure, I'm not seeing a clear reason to prefix the callback with ad7091r. set_mode is probably enough. Same for the ones introduced in later patches.