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 9FC7BCFC271 for ; Tue, 15 Oct 2024 07:53:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aaW2sa/1ZxtztZoldWmZYhD7VcMhjqCGkrdW4rioaxc=; b=yZHBW3lI1Bu4qQLl+3w3PIg2+/ ls5gA9vS3NTbvyw1j6bM9nbkH19dOl3ucYVeHLKpzyHZzD/RWqWjHEAPiJ+qUoryFGDG8Btwn//TA ehbjKWLK/HJUvFR+nFs7cUI/VedAPZ/gNPw4Wam/D2XVNkua9IGwQL38HiNE1t+fggTXz6IYSeGLh xa1RY0jEXx0wzlHL2K1ghN3OG8/OghC1En2jPA80jiOcvUBHNvK6Iyu9/EhSn6/MkNwkVFFwEnaXV UVDGEqXxxU6nRHFb6quaE5bW/9o4pagMVyqNd2OwZdgdvhWGvMg8BzmVGktV7Ev/mfWUXHbhMdwsV 01UhLj8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0cMS-00000007Ok1-0UQV; Tue, 15 Oct 2024 07:52:56 +0000 Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0cL1-00000007OTi-1zor for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2024 07:51:29 +0000 Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-7157c329d93so2479639a34.3 for ; Tue, 15 Oct 2024 00:51:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1728978686; x=1729583486; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=aaW2sa/1ZxtztZoldWmZYhD7VcMhjqCGkrdW4rioaxc=; b=VlHBof3NbyLoCg8wOufhmynCQAKBTvsmCZns4AByFVrVmqrPWzvAgq8esGDhomNk4F B0WDwyBM7tnpXd5sziQuqpAHjP2orZKv0fKMxfQf5VlKtzY8Ll8JKha4GWgEKLi6XctR 1ROPcWrJcOQykrwTU3SWVeGKrFEuTd8ZK9rGY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728978686; x=1729583486; h=in-reply-to:content-transfer-encoding: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=aaW2sa/1ZxtztZoldWmZYhD7VcMhjqCGkrdW4rioaxc=; b=nWTITJYIN4HzSYMPg86GOId1lhRQmNmKQ8e4CC5i7TAFONISmes9vRIjNySIIOsaBV RJx76JO/h6vPu1SB75E9cQ3oB27xqRE+TgAdik/amEVN7oZVE59gh5m+82gKgZ5M/TR9 som5z0A4Vw2KWlaFZlDn6wC0jEJsQfOifgpRFbCOOxW5kEcH1UhSZZDdOgiY2l5H0Kxv ol0lchI/UtZIfhGeQwODOhfadb7tkI1+Blid46Lrp/Ip0rWOYm6h4beiyrbzj5qtd58M Tiz6Q81vJkeIRUn0v5w5esx023KN2Yq7H6qF90kmp9SBMqPc7jQmcoNnuOxctDz59eb8 7Pfg== X-Forwarded-Encrypted: i=1; AJvYcCXCeLl0EYPkBRlg9H2YPQJSpjeeZJkD2Amt9UvAYfIJ/IU1pOWgQmVZerzKIdYHmuzcYu3hVMx0IJu20aA4lvUo@lists.infradead.org X-Gm-Message-State: AOJu0Yynwnb9X38NxHiZkJCJW0Kl8oOC5QpRgy9117qAo8tln4tPkQMy ODx6qrrogNtOKfHTovVuv9xsKU5VJQdi8V+qRJx+ZgXKvTGjDnbMyjCKivaVOQ== X-Google-Smtp-Source: AGHT+IEfvWKZ1jcEyU30hF3ZW6BxaiMzf1hjuhVYl88Vngg8HNiMsojaXq2qzSwNVqU01VmSdulBrA== X-Received: by 2002:a05:6358:52c5:b0:1b5:a38c:11d1 with SMTP id e5c5f4694b2df-1c32bc8c0f9mr537792955d.26.1728978685952; Tue, 15 Oct 2024 00:51:25 -0700 (PDT) Received: from google.com ([2401:fa00:1:10:f99b:9883:3b88:182a]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7ea9c713432sm730557a12.83.2024.10.15.00.51.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 00:51:25 -0700 (PDT) Date: Tue, 15 Oct 2024 15:51:21 +0800 From: Chen-Yu Tsai To: Andy Shevchenko Cc: Rob Herring , Saravana Kannan , Matthias Brugger , AngeloGioacchino Del Regno , Wolfram Sang , Benson Leung , Tzung-Bi Shih , chrome-platform@lists.linux.dev, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Douglas Anderson , Johan Hovold , Jiri Kosina , linux-i2c@vger.kernel.org Subject: Re: [PATCH v8 7/8] platform/chrome: Introduce device tree hardware prober Message-ID: <20241015075121.GA292890@google.com> References: <20241008073430.3992087-1-wenst@chromium.org> <20241008073430.3992087-8-wenst@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241015_005127_569980_14C58D5C X-CRM114-Status: GOOD ( 28.04 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Oct 14, 2024 at 02:25:27PM +0300, Andy Shevchenko wrote: > On Mon, Oct 14, 2024 at 03:04:44PM +0800, Chen-Yu Tsai wrote: > > On Thu, Oct 10, 2024 at 11:29 PM Andy Shevchenko > > wrote: > > > On Tue, Oct 08, 2024 at 03:34:26PM +0800, Chen-Yu Tsai wrote: > > ... > > > > > +static const struct chromeos_i2c_probe_data chromeos_i2c_probe_hana_trackpad = { > > > > + .cfg = &chromeos_i2c_probe_simple_trackpad_cfg, > > > > > > .cfg = DEFINE_I2C_OF_PROBE_CFG(trackpad, i2c_of_probe_simple_ops), > > > > > > Or even > > > > > > #define DEFINE_I2C_OF_PROBE_CFG_SIMPLE(_type_) \ > > > DEFINE_I2C_OF_PROBE_CFG(type, &i2c_of_probe_simple_ops) > > > > > > > + .opts = &(const struct i2c_of_probe_simple_opts) { > > > > > > Perhaps also DEFINE_xxx for this compound literal? > > > > I think it's better to leave this one as is. > > Using a compound literal like this questions the entire approach. I don't follow. It's a valid use. > Why you can't you drop it and use the static initializers? Did you mean split that part out as a separate variable: static const struct i2c_of_probe_simple_opts chromeos_i2c_probe_voltorb_tch_opts = { .res_node_compatible = "elan,ekth6915", .supply_name = "vcc33", .gpio_name = "reset", .post_power_on_delay_ms = 1, .post_gpio_config_delay_ms = 300, .gpio_assert_to_enable = true, }; static const struct chromeos_i2c_probe_data chromeos_i2c_probe_voltorb_touchscreen = { .cfg = &chromeos_i2c_probe_simple_touchscreen_cfg, .opts = &chromeos_i2c_probe_voltorb_tch_opts, }; Instead of the following, which is slightly shorter, and gets rid of one explicit symbol name: static const struct chromeos_i2c_probe_data chromeos_i2c_probe_voltorb_touchscreen = { .cfg = &chromeos_i2c_probe_simple_touchscreen_cfg, .opts = &(const struct i2c_of_probe_simple_opts) { .res_node_compatible = "elan,ekth6915", .supply_name = "vcc33", .gpio_name = "reset", .post_power_on_delay_ms = 1, .post_gpio_config_delay_ms = 300, .gpio_assert_to_enable = true, }, }; ChenYu > > Not every entry will > > use the same combination of parameters. And having the entry spelled > > out like this makes it easier to read which value is for what > > parameter, instead of having to go up to the macro definition. > > > > For comparison, this entry uses just two of the parameters, while for > > another platform I'm working on the full set of parameters is needed. > > > > > > + .res_node_compatible = "elan,ekth3000", > > > > + .supply_name = "vcc", > > > > + /* > > > > + * ELAN trackpad needs 2 ms for H/W init and 100 ms for F/W init. > > > > + * Synaptics trackpad needs 100 ms. > > > > + * However, the regulator is set to "always-on", presumably to > > > > + * avoid this delay. The ELAN driver is also missing delays. > > > > + */ > > > > + .post_power_on_delay_ms = 0, > > > > + } > > > > +}; > > -- > With Best Regards, > Andy Shevchenko > >