Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2266361pxy; Tue, 3 Aug 2021 01:52:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuQxCbowmcOUK3MAS+4htMh+RpUXFWi/+cfomfkQdrLnPbQmpiO5CqkQ4q3zmzc7TfUkCE X-Received: by 2002:a05:6602:59d:: with SMTP id v29mr2283786iox.132.1627980720746; Tue, 03 Aug 2021 01:52:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627980720; cv=none; d=google.com; s=arc-20160816; b=0aguEJRelpkRCjx+uMeFaaDYDmqXjWN5GXVGRKCCOD7Yi63mypDIaPgARGh75QhydO w9QXtg1w80i1NNr3EVsk5lGQWQNgZmxV195i0udevUQIQ5syJeA6OUJlXP4mIz05aTzn rlJtpSe/njv6W/by6JXJs5h3gN+REA+voCeE0Y8YUDXMxfnE6Mkb4XLXkNFbjvmF3JpH z5kUaGNO763FJlfY4vPb/1FqVtX2YvI9JPlFNjweOyUVcfYmoPi35gNMssOKkjm4wa7n nZYFOoDwwVvg10N67VUWLc1xbRoh5veOTpPRA8AmqII7KYPnlQGHAwA2iQeyMyychGd4 xJfA== 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:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=gJSZFhKVP4HKEMu49hVwBOwgPgn/uZOPWaLARXY00kE=; b=oL7z9/lQsrXCd8X4UlObCQiTZJPdGvvIKwp03hmbdRgWzrr9vJ35eKBpLWCgFU8INY r4Xkmz106KyvVCnUL7O5E05nyVLGpH+do1VSKjDIlG/NlKYX5c/Hhq4RtTsq2CGqj9CB 2W0j3vzJIU1BDyBLvzFhtJHu2ud+x7dJHFvISBnEanRCdiAg+zbn9RuorZLIXGmyqqrz 3MbaGoGh4VSlTNOW9JIs7kFPjpbxOx4RDIECIC3ztUoF9uNri8o3eEbytmxRI0AHKGl6 IQCFlwhc3wsn3Z+b2X2KpJUYJ52crMW48zsD1YdNl2DdBoh5xvtCmVOkPJGsv0BtqxL2 9HGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alistair23.me header.s=fm1 header.b=KzgbTPr3; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=EqW95L1f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j8si15724343jak.67.2021.08.03.01.51.49; Tue, 03 Aug 2021 01:52:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alistair23.me header.s=fm1 header.b=KzgbTPr3; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=EqW95L1f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234873AbhHCItx (ORCPT + 99 others); Tue, 3 Aug 2021 04:49:53 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:42519 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234866AbhHCItv (ORCPT ); Tue, 3 Aug 2021 04:49:51 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id 0C3065809FE; Tue, 3 Aug 2021 04:49:40 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 03 Aug 2021 04:49:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=gJSZFhKVP4HKE Mu49hVwBOwgPgn/uZOPWaLARXY00kE=; b=KzgbTPr3fywsrseIj9nRceS7V7xQV bzRppA5eueRyL7f/hlCdUZfQ61iETZJffDpzRATcxxHGQzpZ8GYavNrUOml/ijzA rkUOYCyZhDEXED6FwHtG8ZFB52WSMrTXSFr4pIQYd9AoHIzN/QOdRz8j0LVpZSMV w5j2Vq+menNA0VdPco/O9GLD3S5y8Whn5U9K7EqJ0V0JUQ2/m5OSIKRZ/qfx4rgW XoIXMkVWfNfB/Jn1Oy3IqW/2BWFwCltYUObfUeknlSfzSKQVaVSelrAzdNmhVT03 00x/7aeNp34VO6h9QuWSx7dyKYLa1w+mfVX2byMc+/Xl/s2BM8SqrAqCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=gJSZFhKVP4HKEMu49hVwBOwgPgn/uZOPWaLARXY00kE=; b=EqW95L1f MImTkOFAbyMFJn8lSQKdr1zWlaHhlvxndLEJJgFsnxiQz/LwXctwkN8poo7EH4zh /8pV5mx/nvYpYD25qTQrgYB+4Qg1YG3m7WzbSPINnqm63QQOSwNYEDuhR2hqdvEZ lJ9R9wpCrzNYYMwrj4q0uzcoS7z1ySbDuuZtJjQPlwAEBo+SYLFzYwyLedKUhLnw sj4k51FsQuBWK96ErEO4pKGmvChEAENwoyhvjjFP1eDOqyx8Qf1bC9bto8LgphSH 1OT+2tzOdN++0AOq99KE7YxzRjW4sIqdN14HBaZmrcHuC6EkdOWveS2os67ecuyV iRlXvhnH0Hf7dg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrieeggddtiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhish htrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 3 Aug 2021 04:49:35 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, robh+dt@kernel.org, devicetree@vger.kernel.org, Alistair Francis Subject: [PATCH v8 7/9] Input: wacom_i2c - Add support for vdd regulator Date: Tue, 3 Aug 2021 18:49:00 +1000 Message-Id: <20210803084902.336-7-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210803084902.336-1-alistair@alistair23.me> References: <20210803084902.336-1-alistair@alistair23.me> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for a VDD regulator. This allows the kernel to prove the Wacom-I2C device on the rM2. Signed-off-by: Alistair Francis --- drivers/input/touchscreen/wacom_i2c.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index 49d1c15e623c..df77b17835e4 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,7 @@ struct wacom_i2c { struct input_dev *input; struct touchscreen_properties props; struct wacom_features features; + struct regulator *vdd; u8 data[WACOM_QUERY_SIZE]; bool prox; int tool; @@ -222,11 +224,24 @@ static int wacom_i2c_probe(struct i2c_client *client, if (error) return error; + wac_i2c->vdd = regulator_get(&client->dev, "vdd"); + if (IS_ERR(wac_i2c->vdd)) + return PTR_ERR(wac_i2c->vdd); + + error = regulator_enable(wac_i2c->vdd); + if (error) { + regulator_put(wac_i2c->vdd); + return error; + } + wac_i2c->client = client; input = devm_input_allocate_device(dev); - if (!input) + if (!input) { + regulator_disable(wac_i2c->vdd); + regulator_put(wac_i2c->vdd); return -ENOMEM; + } wac_i2c->input = input; @@ -261,6 +276,8 @@ static int wacom_i2c_probe(struct i2c_client *client, IRQF_ONESHOT, "wacom_i2c", wac_i2c); if (error) { dev_err(dev, "Failed to request IRQ: %d\n", error); + regulator_disable(wac_i2c->vdd); + regulator_put(wac_i2c->vdd); return error; } @@ -270,6 +287,8 @@ static int wacom_i2c_probe(struct i2c_client *client, error = input_register_device(wac_i2c->input); if (error) { dev_err(dev, "Failed to register input device: %d\n", error); + regulator_disable(wac_i2c->vdd); + regulator_put(wac_i2c->vdd); return error; } -- 2.31.1