Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp389289pxv; Thu, 8 Jul 2021 05:02:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCs9qywfl3Q5OLuyesxCq92TuKbwcwg8HwQ2gpqgoG551r11TIJXeJvhI0bzo2zkVfuX/z X-Received: by 2002:a1c:f206:: with SMTP id s6mr31833305wmc.102.1625745774504; Thu, 08 Jul 2021 05:02:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625745774; cv=none; d=google.com; s=arc-20160816; b=Ik1x9+ksqF6jBUkAiEJCPO3pENfnEjgYEo7dnCmsdzoQoJO0GMivqsdxOhSbXQecw3 TDMSzpBasz0W0/2johRWmoYsLHpP+lRHkAY84w++Le0bO+wtnB2kGwbX+LAqAwBdaY2b A8xlbyZiqKsFWZMDvSYUUlLMltBboOM4ZPXPErZtKCM44GmW2NwWwwkUWNCW0/FKbBdo M0Hp84zQx5OokOEpek6wANgykAE9sLK5UJNPKfMv1fhNX0BLpgD/WIuWlkxV9KlYXLNh 9o5/bqRYDWCVlzL3KSVp6V3utBxhfrlkqBB/SIJDZ8N+jLoizm7el72fscRztqmeKign Ahvw== 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=A/bREnnX/N0oblbV3LWU17xV66YLosbYls3ABsgi/iFPPTmBwfbBQA/RmILd+1PFMm PsynIlMQYYqu2GWvOn8epISjQ7qrf40/apTclb7BR2JtwQk8zxaS5/lljj+Ab8d0HG1i dXqmNGALR3lsOqAtg6K3TUb+yBqozW9+3Xy3tVwgPD/E3YvHGE9Qnq6YYzK6B/q7iC/O RjXM0ZKjGimeIU1I3vHccGyRvxHbselBrcpuDfzWfYIkrJWGfRaE0FwGd4Lko252az6g KgCX7NXyYKpRavP4bCvF1pbpZ7Q4unqvTrmWlbMXSMInhgCG7sGRmldJjaS7NjVLI9od Zv8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alistair23.me header.s=fm1 header.b=R7Exi59p; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=a4xKCPLT; 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 ar26si2545396ejc.427.2021.07.08.05.02.30; Thu, 08 Jul 2021 05:02:54 -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=R7Exi59p; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=a4xKCPLT; 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 S231924AbhGHMCW (ORCPT + 99 others); Thu, 8 Jul 2021 08:02:22 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:44565 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231382AbhGHMCW (ORCPT ); Thu, 8 Jul 2021 08:02:22 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 3A17B58057A; Thu, 8 Jul 2021 07:59:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 08 Jul 2021 07:59: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=R7Exi59pvZZ1O/wLtUlwprEPR7Avy CfweQdojUBKlebCW5KK/a/V5SaxUEA95Ai9i+BvEgO+4yHaJ26O1ZUBzvV0divV0 eZj50I1OUVWk7X3HrNexihvhvKVY9h1SvhYu/RiPv0txsoxSeaKJIxBEykqj229G UqQ/3RnR//UiyQdGmlouVeG3nkiz5QUgB6++xlgDhej/JBpmmdtDM7FTjSdlMS8K xaeh9RvB4JhXeIZc970w/ofKUjnYWlmvvqCmMkmRWKZlE6KSe5HMOanwiwPxaIBe vGawiAK/iNHJaTiknljf6bZkcqs05omDvgQIUzAY5qhhdTywLeWq0msyg== 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=a4xKCPLT /5NqTguWL8CGD8JC2mFjL0q0ZoXwwcfnjU5DkQTk0SfV22qD7Ktt3HlVuKcxzJXD xIyNqCv66Jab/yokvzlQZKY3FRMoLxF+gzZnv/FC9/VIDNcTIGT0HMT1HQU+XoYH u9hWOF6DxIWecGWj+SwBnDgj8n+gpOobhylosoLY8/UdJY34WJnihZ4IMxYkS7OF OZstUGkamUvE9z9IkbttlsKJ3g5u0EdbcqmPqdXJXg8TBoi8jUFsrVKrunsqJH3u BCJRMi2V8Uk9v0uu99jt9fARm2FHu5lYVc+JKYVilH0QQ8x2uD7llmExhquZBHeg 3JXdPSSCwKs1VA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrtdeggdegiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeetlhhishhtrghirhcuhfhrrghntghishcuoegrlhhishhtrghi rhesrghlihhsthgrihhrvdefrdhmvgeqnecuggftrfgrthhtvghrnhepgeegtdetjeekge eguefgheeuvedugedvteejveeiudegvddtkeffkeehtdetudfhnecuvehluhhsthgvrhfu ihiivgepfeenucfrrghrrghmpehmrghilhhfrhhomheprghlihhsthgrihhrsegrlhhish htrghirhdvfedrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 8 Jul 2021 07:59: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 v7 7/9] Input: wacom_i2c - Add support for vdd regulator Date: Thu, 8 Jul 2021 21:58:51 +1000 Message-Id: <20210708115853.281-8-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210708115853.281-1-alistair@alistair23.me> References: <20210708115853.281-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