Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp233718imn; Mon, 25 Jul 2022 14:56:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tqN12LpxzPZvaIOr/xxkJ7AZixlDP4BCbtQNI4UbvCfDPRFgST33Qc8AakXpGv+p+45v7T X-Received: by 2002:a17:90b:4a42:b0:1f2:b638:bc2e with SMTP id lb2-20020a17090b4a4200b001f2b638bc2emr7289060pjb.185.1658786208997; Mon, 25 Jul 2022 14:56:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658786208; cv=none; d=google.com; s=arc-20160816; b=d28A64iEb8iAir5fjGvPNjdBE2ePd5MS7VQzPW8bH2v3V/YyyljYs2H9e5LcFvGAQk ZAtsRQhlIOfV9YNG50hunLm5IJPzJ4ljemPSySp2raT2UpLvsp9oqWuKqpel266lGXM3 nNkrY7IfjdIR7HD2yAeHpDNpEXe3RQ8bQD4wkXsnfrxXY0o7nj0ZKReLfZx4QkEdAlux qBPJppg7g40G2UCSsk9HXZGY+sXIuorVsWDNFUBaOs4+REjWUdpmShidJdrePpmKJleI imLd0FfGuvXKv7Ri1E6sWchi8a16CIKPGTsEZYAVOcmbveY9il0yfJ17jdz7oYePIc+5 IVAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=rGBbKknERGaQR66mfFe62XOVnr8XdLDPSXcuJYtRG8s=; b=Fkv4Q7KfTba7f5qcCBhpl3VCg7eFLs026/IlfZvuJBgP5T0ShduA9XA1Y3gpcg6ffl Hj9pWHst9durjL4g2z7XzDsZ1wkLJa2dycpXqMZ5+ZHfOdZxoF9YHDhxPxbzdwxJtU7k /DoDxwMlIIjpEL1X/njZ2qnAyjIUo0K4gBjleblNv1Cr2WaOBEFZdhQbiaO8fcVz7JTi ntJN+fBZb7ctIZxXF7D9GVXdeZ1tcy1lddpnmJ0iG3zoGwa6g3H+OuC3A9xZzVbZWUD2 lMq/YVXa3fGYxLczQEvgIr+0dA2+3Rabnxg/bD7VeCMPETqnPreJZoybW+Hi5iLzCl0n 7KzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YeQ32C0C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z137-20020a63338f000000b003fe494520a9si9366152pgz.357.2022.07.25.14.56.33; Mon, 25 Jul 2022 14:56:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YeQ32C0C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234899AbiGYVGC (ORCPT + 99 others); Mon, 25 Jul 2022 17:06:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229915AbiGYVGB (ORCPT ); Mon, 25 Jul 2022 17:06:01 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BB811FCD6; Mon, 25 Jul 2022 14:06:00 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id z22so15540211edd.6; Mon, 25 Jul 2022 14:06:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rGBbKknERGaQR66mfFe62XOVnr8XdLDPSXcuJYtRG8s=; b=YeQ32C0CB7mfUuZjqJHigX92cDaPLNsvkiX/YXHX/jW5BJoCjfdEgvOfhscT0R0u+I 80GgEtBuZSO+bPHnC56Qw1unzThVTq9vcT8AKcltRcifr/q7YpXpI54oMYKSLabFbtAy q0dDZrJlpM2bVhLDgl/+JCJgqYRh1rkVSJXymLjBJuH1kcSAYt5pEFlh5YdH7/B3g0TS afkCcK/ptmqyEsBLUFRfA3YWCDfWYxGSrcAQX+cMj2BENbmoa4ox+z259h/IWt0iXqTO MyQLcHqSdK/1P8V8sPJ2WS34p57Kn9Xjl7bGW8+4ErkC3LqkNJx5r3asbb5crQivu160 ZExw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rGBbKknERGaQR66mfFe62XOVnr8XdLDPSXcuJYtRG8s=; b=JEjVmC0MWhowD8ysm/UnXchOEiymJXt/9o+Tb/WYyh2nSq3rQ+CDLJjHpkToDjyAO0 5rEFXh8x4DD+iC/v63IcrROewuPU2ijFuBTLRFrWGaNQ1oQtigH6S0ugZXvMPr14sW6B thLSkoVS5hFSfBM2fdUO/HpMwSpwCxAYBjY4A6sMCRxAjNpB41cwvwitfPm65Am4Pu2b rz4JUHJDCIKdl3hCWESNLGS6G1DVAQo6Wmag8g+sg8sZs7kO8Wrw6+YX3cNFkHUmMw1H sveFzi2YFbz3yF+rRo/sVqKRxucfQstqUYO9NJVR+WD1vBc4G1sb6WrwNnXYO3FQbaPc 7dVQ== X-Gm-Message-State: AJIora+w1N209Er3pBAxGqo6ZhKGpGaqlL3LLGni/vEy7iq1LsmxkkGO 7uQcRu/c8ZbUPoOkxGAtg0D7BOppjGmg0SlFnZM= X-Received: by 2002:a05:6402:50c9:b0:43c:163a:4d5f with SMTP id h9-20020a05640250c900b0043c163a4d5fmr4943645edb.386.1658783159031; Mon, 25 Jul 2022 14:05:59 -0700 (PDT) MIME-Version: 1.0 References: <44a301d5605bcf5b30ae60b21d0b312717b938bc.1658597501.git.ang.iglesiasg@gmail.com> In-Reply-To: <44a301d5605bcf5b30ae60b21d0b312717b938bc.1658597501.git.ang.iglesiasg@gmail.com> From: Andy Shevchenko Date: Mon, 25 Jul 2022 23:05:22 +0200 Message-ID: Subject: Re: [PATCH v4 2/5] iio: pressure: bmp280: simplify driver initialization logic To: Angel Iglesias Cc: linux-iio , Jonathan Cameron , Lars-Peter Clausen , Paul Cercueil , "Rafael J. Wysocki" , Ulf Hansson , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 23, 2022 at 7:40 PM Angel Iglesias wrote: > > Simplified common initialization logic of different sensor types > unifying calibration and initial configuration recovery. > > Default config param values of each sensor type are stored inside > chip_info structure and used to initialize sensor data struct instance. > > The auxiliar functions for read each sensor type calibration are converted > to a callback available on the chip_info struct. ... > + .oversampling_temp_default = ilog2(2), > + .oversampling_press_default = ilog2(16), > + .oversampling_humid_default = ilog2(16), > + .oversampling_temp_default = ilog2(1), > + .oversampling_press_default = ilog2(8), It's a very interesting way of writing BIT(x)... -- With Best Regards, Andy Shevchenko