Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp677456rdb; Thu, 30 Nov 2023 15:34:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJjmNCMdfisRz9jkNqI2IxtgYat1PZ7eL4Z+aAFOdCZG58K28wiAuR2rXcxm231m8JLUBw X-Received: by 2002:a17:902:f689:b0:1cf:d620:c641 with SMTP id l9-20020a170902f68900b001cfd620c641mr17135292plg.22.1701387266979; Thu, 30 Nov 2023 15:34:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701387266; cv=none; d=google.com; s=arc-20160816; b=0fmi8DLZ1dijCmA8mICCeZQqdeEjQu8msG5OzCxIneRJNQMV5hdxsISStVWcUBd/gJ OMTC79EBCSJlD4YYEw2dqRfQeX7nmAYewfy3o1nSNg4o1fth5Y6cDLqh1E1i2bXvosOh Vact9lH0Aypx9Uik3kHw9skfJcO85C9HbUQkxDQSVaSwp+Gdlx+Iql8b9jMf/I22Q97M QVouYXsXv54sIuokWs9mEg4iiUicuuJ0ElqAIAIsOsIUCxXBQ24fjRO8HiMEDZk8QaHd 7JUeCiW9dboHtKKqlDMgWU54ZuhQ3bRBndA/6EttmNEnUqgIt0hiZR7zEhYpwKpVJhKz Kzvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=JQZO2smk9lB8IbFGyWpiiaWx+EoPvHvBmIDoExFNLfs=; fh=ttWv8VCoGF50n4AB/K9MI+yMSg75NE7RBe49baFg6DU=; b=E/vR+liul4BvcNDT4piqBlQTMDLmKulte8L3A2hfrFP0e7aqXQwY2ro5rHt7cWGubX 6Z9xlhrgaybwxz4CK+oPDyr5n8GTGubVQ7bAdpxcRRLof4pco83J+4YxyvivDotcGtDo DqCcLFvJpbpOtqG4cAYQqKP4vEiDl0+oF69UDP/j7vo8G3wlMxcO/4GWPjQeLtYAinSh fF2grjL5goAVEJyn68lEq6zDkVGB2UXG5VTOK5c4ZbpVcl63HYL2ald7Vy23VAsm+EWV p1Xh5OtSl0MLMEhqn4K8bbl9uHlG7vo1PzaUo1ShOAVympAbSovfMyTmrs13kVXws5Lz IQ1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=gMGAQTSQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id s2-20020a170902b18200b001bbb175a81asi342485plr.263.2023.11.30.15.34.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 15:34:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=gMGAQTSQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 8FE7C80F5F17; Thu, 30 Nov 2023 15:34:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377259AbjK3XeI (ORCPT + 99 others); Thu, 30 Nov 2023 18:34:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377250AbjK3XeH (ORCPT ); Thu, 30 Nov 2023 18:34:07 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 970A710E4 for ; Thu, 30 Nov 2023 15:34:11 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-50bb92811c0so1532734e87.1 for ; Thu, 30 Nov 2023 15:34:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1701387250; x=1701992050; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=JQZO2smk9lB8IbFGyWpiiaWx+EoPvHvBmIDoExFNLfs=; b=gMGAQTSQURSXc7mTg/GbOCnWsqHvSn1TrGiEwckP07HIHh20ORy9AHIBudW1KUhp11 rR4BCQBE/xnQ0qjlttSnOqbeAegxvEHNJS/Lc0nn/4Y+XNZwSzoaYG0VtSeQQWCaSar+ DHRmELFtGmVXwCVx2HdGP5D7nrOAeubgAe8fdH6oWu9NMdAlZOVQWed/YRo4QgchukBT j1vWyRCvcRwvLVWpa8IqPqDK5x7Oi9YXbIhmV2tKZNkRCpXUkUnWtVfiB5DVqn5cwo0D 8f0PUQksZkbXwzXed8yG8FvoCipwhzRkTKJkU4iS0Cpe9wd2JrRdoQfkDn9P04Gzs4Jd EhbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701387250; x=1701992050; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JQZO2smk9lB8IbFGyWpiiaWx+EoPvHvBmIDoExFNLfs=; b=paKjsLCwdPQ4PpHmZFgomQKpcozLS4e3iiEDWhoVZ5QLSBLu9T6XDyq4+K6EiWXtZa S9CMs4ZWXs9pECtr6Y+iEcDkO1GOIsyJeMl5yPGzMRUN9w+N49ZkrF11METdk2LoRlMy zInW7qGaLWIg5jhd7MopffUSwdMpMlfSQj5bP2PQjnUvF8I/BxVz/wl//G3yL3tWmaMx 94pxa/X3JCBvZGTRo468LBHfkkFo2SOJAGZ+uIkDzII7i+QBuAp2LdZJFFj59axdcyzm QLGmbukaa/xW4fHaZFNJGu+b9FCbKbPrJ4jMpmfvKptRfVXSMArhj6dzd3J7kphLMtaG EgnQ== X-Gm-Message-State: AOJu0YyaeEbivb9a6WyzfsSMcHUdr6BFluqa7Kd56pvmlh5g8qeGxnVc 1+Y4Xbfi1YVC9+355GgziqdP05pezA7QbTPSy+XauQ== X-Received: by 2002:a05:6512:b96:b0:50a:ae89:491f with SMTP id b22-20020a0565120b9600b0050aae89491fmr211943lfv.3.1701387249855; Thu, 30 Nov 2023 15:34:09 -0800 (PST) MIME-Version: 1.0 References: <20231121-dev-iio-backend-v1-0-6a3d542eba35@analog.com> <20231121-dev-iio-backend-v1-12-6a3d542eba35@analog.com> In-Reply-To: <20231121-dev-iio-backend-v1-12-6a3d542eba35@analog.com> From: David Lechner Date: Thu, 30 Nov 2023 17:33:59 -0600 Message-ID: Subject: Re: [PATCH 12/12] iio: adc: adi-axi-adc: move to backend framework To: nuno.sa@analog.com Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, Olivier MOYSAN , Greg Kroah-Hartman , "Rafael J. Wysocki" , Rob Herring , Frank Rowand , Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 30 Nov 2023 15:34:24 -0800 (PST) On Tue, Nov 21, 2023 at 4:17=E2=80=AFAM Nuno Sa via B4 Relay wrote: > > From: Nuno Sa > > Move to the IIO backend framework. Devices supported by adi-axi-adc now > register themselves as backend devices. > > Signed-off-by: Nuno Sa > --- > drivers/iio/adc/Kconfig | 1 + > drivers/iio/adc/adi-axi-adc.c | 364 ++++++++----------------------------= ------ > 2 files changed, 65 insertions(+), 300 deletions(-) > > diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig > index af56df63beff..cc42a3399c63 100644 > --- a/drivers/iio/adc/Kconfig > +++ b/drivers/iio/adc/Kconfig > @@ -292,6 +292,7 @@ config ADI_AXI_ADC > select IIO_BUFFER > select IIO_BUFFER_HW_CONSUMER > select IIO_BUFFER_DMAENGINE > + select IIO_BACKEND > depends on HAS_IOMEM > depends on OF > help > diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.= c > index c247ff1541d2..b2ab2c119efa 100644 > --- a/drivers/iio/adc/adi-axi-adc.c > +++ b/drivers/iio/adc/adi-axi-adc.c > @@ -390,37 +166,23 @@ static int adi_axi_adc_probe(struct platform_device= *pdev) > if (ret) > return ret; > > - if (cl->info->version > ver) { > + if (*expected_ver > ver) { > dev_err(&pdev->dev, > "IP core version is too old. Expected %d.%.2d.%c,= Reported %d.%.2d.%c\n", > - ADI_AXI_PCORE_VER_MAJOR(cl->info->version), > - ADI_AXI_PCORE_VER_MINOR(cl->info->version), > - ADI_AXI_PCORE_VER_PATCH(cl->info->version), > + ADI_AXI_PCORE_VER_MAJOR(*expected_ver), > + ADI_AXI_PCORE_VER_MINOR(*expected_ver), > + ADI_AXI_PCORE_VER_PATCH(*expected_ver), > ADI_AXI_PCORE_VER_MAJOR(ver), > ADI_AXI_PCORE_VER_MINOR(ver), > ADI_AXI_PCORE_VER_PATCH(ver)); > return -ENODEV; > } > > - indio_dev->info =3D &adi_axi_adc_info; > - indio_dev->name =3D "adi-axi-adc"; > - indio_dev->modes =3D INDIO_DIRECT_MODE; > - indio_dev->num_channels =3D conv->chip_info->num_channels; > - indio_dev->channels =3D conv->chip_info->channels; > - > - ret =3D adi_axi_adc_config_dma_buffer(&pdev->dev, indio_dev); > + ret =3D devm_iio_backend_register(&pdev->dev, &adi_axi_adc_generi= c, st); > if (ret) > return ret; > > - ret =3D adi_axi_adc_setup_channels(&pdev->dev, st); > - if (ret) > - return ret; > - > - ret =3D devm_iio_device_register(&pdev->dev, indio_dev); > - if (ret) > - return ret; > - > - dev_info(&pdev->dev, "AXI ADC IP core (%d.%.2d.%c) probed\n", > + dev_info(&pdev->dev, "AXI ADC IP core (%d.%.2d.%d) probed\n", Was this format change intentional? There are other places above where %c is still used. > ADI_AXI_PCORE_VER_MAJOR(ver), > ADI_AXI_PCORE_VER_MINOR(ver), > ADI_AXI_PCORE_VER_PATCH(ver)); > @@ -428,6 +190,8 @@ static int adi_axi_adc_probe(struct platform_device *= pdev) > return 0; > } > > +static unsigned int adi_axi_adc_10_0_a_info =3D ADI_AXI_PCORE_VER(10, 0,= 'a'); > + > /* Match table for of_platform binding */ > static const struct of_device_id adi_axi_adc_of_match[] =3D { > { .compatible =3D "adi,axi-adc-10.0.a", .data =3D &adi_axi_adc_10= _0_a_info }, > > -- > 2.42.1 > >