Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp1289263rdb; Mon, 21 Aug 2023 03:24:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFN6nLH7XlG/6R7UFBycpl3oBNTknnCmgl1CcyhFPWFJOKr7VWM8F5oqUhwIuZnbAMbyFh2 X-Received: by 2002:a9d:7301:0:b0:6bc:cd0d:427e with SMTP id e1-20020a9d7301000000b006bccd0d427emr6004649otk.38.1692613464417; Mon, 21 Aug 2023 03:24:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692613464; cv=none; d=google.com; s=arc-20160816; b=Li53Cx41WizE+FlejH1zf2D7Dmf3SmXbZKACY9lQhLcPqJm6/roeapXQXanG+pZ3NB X7pXyHfr1HR8GP9anIyMWrmmSSoxn43LqtZOS7qd73JSYimDvRG7BHycSh9IHIBoVrHs gvfyUvCUxgATTxrD5Ixvo4jdbCw9Dn11Ml3VI2afok3azHFEcqzWCadOsEncH+JFSPSe vYY8VrFE+0q2/2xw6DXwTDA95sds+YOgXFa+02WlU/5MXrq6fXXlp9P9/HK5rkdazEPo 39A/W5nY7ldNqQv//zt+C1EEyCd36/99dfIwsOPlQwiekOGkwTJ2mKN/Hvof5j1wLLmA 5xzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qY9Jq8BuskmGhSBNN8D7r1gUvebcWfIzO4L3sCRrKPs=; fh=II1oBFdf/DJ1BOCGql855kFUBejY11CzR0E2iswuxuM=; b=OmOnnGXxLmMUIrr+FNVtDo1Jv+VlNl0yND+itOjPhqv/KmV8PcAWHwx9YOCiQJhu5s TzogYP3NTSnN6qvFjkyJi77GlMJsvwob6OyaClYUH44GC5iS8ql5Kf3QnjYlx7Mu9U0Y lJsLoqS50Wc0jfbgHxEcgxUos9kQLYMMbEzeyFwXVsamSU+SR4jRVFNyacld4tJsTgwx YWEWxpHUwWVO3OXWjKX3RGcq+zoFWRQ0lZ2tBu8q4CUgSTu/fgngII8EYbS3fPOoyvEv Nh4VC2+TcLLkcwVSoJ7u3sdOHS5LZTa/E71rbyOIsuO05exSK2PdQqgSGz6yIKNzt007 nJ7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L9aT17Zh; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a7-20020a656407000000b00553c4551a08si7183862pgv.887.2023.08.21.03.24.12; Mon, 21 Aug 2023 03:24:24 -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=@kernel.org header.s=k20201202 header.b=L9aT17Zh; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234254AbjHUJBi (ORCPT + 99 others); Mon, 21 Aug 2023 05:01:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232615AbjHUJBh (ORCPT ); Mon, 21 Aug 2023 05:01:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E98DC1; Mon, 21 Aug 2023 02:01:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 07BC661197; Mon, 21 Aug 2023 09:01:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6A96C433C8; Mon, 21 Aug 2023 09:01:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692608494; bh=bpgMRFrtUvUUXxIRX8UHoRJTPj6PZfbFDNTb259U9fg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=L9aT17ZhTZ4u963nqxRiyPFs17esZyEzjnVQoPKyaBwDxHm+BtAxAoszFELC08uct KQAxtC21QSla3nTAqOBoXCq8e99DpHegUAfTuSqyHhOUM56cjermFvrEfAp2Zkv1fG bEy6F7a4r9V7ceiKkx8NWRZxrMw7kiLVrJSngh3t7Vv8RQuvK+2ssuI6Ut+6seY87a VPWZkdtDlENOXZtF8zn3kpmuIyMS0Y0MaNKxDbqZ8eCpGgm9f7IGhPCFleLMGRP8/D qyEoEcOH64tJkmNW9FLpgPYAMz0OunghvcjDAAWDShdOHvuFYCM7JH/hHqXOVUfA9A F8QDE0ilv3UsA== Date: Mon, 21 Aug 2023 11:01:28 +0200 From: Benjamin Tissoires To: Doug Anderson Cc: Cong Yang , benjamin.tissoires@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, dmitry.torokhov@gmail.com, jikos@kernel.org, hsinyi@google.com, linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 2/2] HID: i2c-hid: elan: Add ili9882t timing Message-ID: References: <20230802071947.1683318-1-yangcong5@huaqin.corp-partner.google.com> <20230802071947.1683318-3-yangcong5@huaqin.corp-partner.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Aug 02 2023, Doug Anderson wrote: > Benjamin, > > On Wed, Aug 2, 2023 at 12:20 AM Cong Yang > wrote: > > > > The ili9882t is a TDDI IC (Touch with Display Driver). The > > datasheet specifies there should be 60ms between touch SDA > > sleep and panel RESX. Doug's series[1] allows panels and > > touchscreens to power on/off together, so we can add the 65 ms > > delay in i2c_hid_core_suspend before panel_unprepare. > > > > Because ili9882t touchscrgeen is a panel follower, and > > needs to use vccio-supply instead of vcc33-supply, so set > > it NULL to ili9882t_chip_data, then not use vcc33 regulator. > > > > [1]: https://lore.kernel.org/all/20230727171750.633410-1-dianders@chromium.org > > > > Reviewed-by: Douglas Anderson > > Signed-off-by: Cong Yang > > --- > > drivers/hid/i2c-hid/i2c-hid-of-elan.c | 50 ++++++++++++++++++++------- > > 1 file changed, 38 insertions(+), 12 deletions(-) > > > > > > diff --git a/drivers/hid/i2c-hid/i2c-hid-of-elan.c b/drivers/hid/i2c-hid/i2c-hid-of-elan.c > > index 029045d9661c..31abab57ad44 100644 > > --- a/drivers/hid/i2c-hid/i2c-hid-of-elan.c > > +++ b/drivers/hid/i2c-hid/i2c-hid-of-elan.c > > @@ -18,9 +18,11 @@ > > #include "i2c-hid.h" > > > > struct elan_i2c_hid_chip_data { > > - unsigned int post_gpio_reset_delay_ms; > > + unsigned int post_gpio_reset_on_delay_ms; > > + unsigned int post_gpio_reset_off_delay_ms; > > unsigned int post_power_delay_ms; > > u16 hid_descriptor_address; > > + const char *main_supply_name; > > }; > > > > struct i2c_hid_of_elan { > > @@ -38,9 +40,11 @@ static int elan_i2c_hid_power_up(struct i2chid_ops *ops) > > container_of(ops, struct i2c_hid_of_elan, ops); > > int ret; > > > > - ret = regulator_enable(ihid_elan->vcc33); > > - if (ret) > > - return ret; > > + if (ihid_elan->vcc33) { > > + ret = regulator_enable(ihid_elan->vcc33); > > + if (ret) > > + return ret; > > + } > > > > ret = regulator_enable(ihid_elan->vccio); > > if (ret) { > > @@ -52,8 +56,8 @@ static int elan_i2c_hid_power_up(struct i2chid_ops *ops) > > msleep(ihid_elan->chip_data->post_power_delay_ms); > > > > gpiod_set_value_cansleep(ihid_elan->reset_gpio, 0); > > - if (ihid_elan->chip_data->post_gpio_reset_delay_ms) > > - msleep(ihid_elan->chip_data->post_gpio_reset_delay_ms); > > + if (ihid_elan->chip_data->post_gpio_reset_on_delay_ms) > > + msleep(ihid_elan->chip_data->post_gpio_reset_on_delay_ms); > > > > return 0; > > } > > @@ -64,8 +68,12 @@ static void elan_i2c_hid_power_down(struct i2chid_ops *ops) > > container_of(ops, struct i2c_hid_of_elan, ops); > > > > gpiod_set_value_cansleep(ihid_elan->reset_gpio, 1); > > + if (ihid_elan->chip_data->post_gpio_reset_off_delay_ms) > > + msleep(ihid_elan->chip_data->post_gpio_reset_off_delay_ms); > > + > > regulator_disable(ihid_elan->vccio); > > - regulator_disable(ihid_elan->vcc33); > > + if (ihid_elan->vcc33) > > + regulator_disable(ihid_elan->vcc33); > > } > > > > static int i2c_hid_of_elan_probe(struct i2c_client *client) > > @@ -89,24 +97,42 @@ static int i2c_hid_of_elan_probe(struct i2c_client *client) > > if (IS_ERR(ihid_elan->vccio)) > > return PTR_ERR(ihid_elan->vccio); > > > > - ihid_elan->vcc33 = devm_regulator_get(&client->dev, "vcc33"); > > - if (IS_ERR(ihid_elan->vcc33)) > > - return PTR_ERR(ihid_elan->vcc33); > > - > > ihid_elan->chip_data = device_get_match_data(&client->dev); > > > > + if (ihid_elan->chip_data->main_supply_name) { > > + ihid_elan->vcc33 = devm_regulator_get(&client->dev, > > + ihid_elan->chip_data->main_supply_name); > > + if (IS_ERR(ihid_elan->vcc33)) > > + return PTR_ERR(ihid_elan->vcc33); > > + } > > + > > return i2c_hid_core_probe(client, &ihid_elan->ops, > > ihid_elan->chip_data->hid_descriptor_address, 0); > > } > > > > static const struct elan_i2c_hid_chip_data elan_ekth6915_chip_data = { > > .post_power_delay_ms = 1, > > - .post_gpio_reset_delay_ms = 300, > > + .post_gpio_reset_on_delay_ms = 300, > > + .hid_descriptor_address = 0x0001, > > + .main_supply_name = "vcc33", > > +}; > > + > > +static const struct elan_i2c_hid_chip_data ilitek_ili9882t_chip_data = { > > + .post_power_delay_ms = 1, > > + .post_gpio_reset_on_delay_ms = 200, > > + .post_gpio_reset_off_delay_ms = 65, > > .hid_descriptor_address = 0x0001, > > + /* > > + * this touchscreen is tightly integrated with the panel and assumes > > + * that the relevant power rails (other than the IO rail) have already > > + * been turned on by the panel driver because we're a panel follower. > > + */ > > + .main_supply_name = NULL, > > }; > > > > static const struct of_device_id elan_i2c_hid_of_match[] = { > > { .compatible = "elan,ekth6915", .data = &elan_ekth6915_chip_data }, > > + { .compatible = "ilitek,ili9882t", .data = &ilitek_ili9882t_chip_data }, > > Logically, this patch depends on the panel-follower series that's now > landed in drm-misc-next. With your Ack, I'm willing to land these two > patches into drm-misc-next too. Other options: If you are fine with the code, I think it could go with the drm tree given that it depends on the panel-follower. Unless it's too late for you to take 6.6 material (sorry I was off in August and just came back). Acked-By: Benjamin Tissoires Cheers, Benjamin > > a) We could land the two patches in the i2c-hid tree since they don't > appear to conflict. The touchscreen won't actually function until the > patches meetup in linux-next but I don't think they'll give any > compile errors (I haven't double-checked that, but I can). ...though > it's possible that the dt bindings might generate errors? Again, I can > investigate if we want to go this way. > > b) We can snooze this for a few months and you can pick it to i2c-hid > when my series reaches mainline. > > Let me know how you'd like to proceed. > > -Doug