Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp8018pxb; Wed, 20 Jan 2021 23:11:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwtlDHGphie/cZLrYlCVzx/GqJXph4P4N8QQxKoOn0dcicvmiPgQ4/YO6jmg953ObLJsSjD X-Received: by 2002:a17:906:369a:: with SMTP id a26mr8054108ejc.276.1611213112223; Wed, 20 Jan 2021 23:11:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611213112; cv=none; d=google.com; s=arc-20160816; b=jQr6/pOCVL/+tnkl2SuvhVCa3ciPsyr8zpT8MtkQJQggfyS7Uot3GxfmUcM4dNpIQ1 UTwuVfPt0ZunoGAhX4md3dDrJQ3bd81x4D7PN9iBYHEIKgXW8Fs9j6KUZ6+Ntws43rTI jFMpagFhHj8JTrDR/7Xjxz71MxvFac9xT5YaSSAKHiPaicNmWNKUBZBlqnbsqkBopGIl 3dYQXTs0s0p+gF5CJHVjL+PggX0jygwlcfADclSuW9Fy1maOfzE2angA49tm+KXmoVpF nwkif9KhOWWfVb36aItEgkz0rcY3JJRgA3gH/etGSGAmoRjx7SGcogxPJMd3+nFIAnIP 8BhA== 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=Uht3iC/SsfC5uzyT3GSWG1iiRBlvfC4inAbmhJVb0aA=; b=mB/9VWDlxMHizqR8Ei28GDhwQVll3xISoSBIWUuagMORKi0lJfx059hwDzrrLVNXOA 3c9xJWKZdrREsOWqzuiUU0Ns3Up/ryBMjpuh3mD3hS6HFe6kHdeRqmnvljHhcUKDJUw4 yJ+GDDFFeZWuO5QG2B1khiY+HQTIlclq2e8dODGsm8mxg+YVREjfCCJARjtCZKn3lzHw vKEoQkBUHB8/iTBsJmic3c0juh09xUV+Hj0QGEX9ntMaPnsxhNnm0DMx/enAEyCB2cGr oLmsOwZgeBoh+5ISPJZk1vc9p93xXbWuGFuB7r9wonq+MacLXPHAN7dWlwh8lxroJBqq YsHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alistair23.me header.s=fm3 header.b=KsNAtJHR; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=GESiybsf; 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 u19si1810794edo.465.2021.01.20.23.11.28; Wed, 20 Jan 2021 23:11:52 -0800 (PST) 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=fm3 header.b=KsNAtJHR; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=GESiybsf; 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 S1726131AbhAUHIg (ORCPT + 99 others); Thu, 21 Jan 2021 02:08:36 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:40903 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727078AbhAUHAR (ORCPT ); Thu, 21 Jan 2021 02:00:17 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 023AC5C00EB; Thu, 21 Jan 2021 01:56:53 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 21 Jan 2021 01:56:53 -0500 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=fm3; bh=Uht3iC/SsfC5u zyT3GSWG1iiRBlvfC4inAbmhJVb0aA=; b=KsNAtJHRIlTwkDfWoQOUOQ5ZNPc4g W3H+MCAZRA5F6iySliLpkHGzWcLzKMMNMZgUAR6vvGPJsbXDVJJPbJoiEBKUktLU iribAnAxqDx5U5l2+O2nzs3dx73mvF/hRDi+OLaKAI9ND6xbiVYU8uB3/Yv9kd4D xDLa6m0R6/EKKsgpWYv4pPLxdeR+nbwvD9aeHaaqADyobNYKOIQpIU7brM2mkfDE mGqt/GKEO4Ua1oH6I0zT+ylQwZqja6e/XYH07piet5jy/XygvOEB2xIu1jf6Vvq5 h6Jv847hA74NhgtzR61ssPzU5O8SqjAFeHluayGf4dcYimiAaDcmg6c+A== 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= fm1; bh=Uht3iC/SsfC5uzyT3GSWG1iiRBlvfC4inAbmhJVb0aA=; b=GESiybsf VaUj5cXBQVJnpYIE/YCc7zTQl/FuYC3at7ROFguUAiAbqGG8iIA41cQf7XwZCHuX ig/mDpFPEMBlidBSQ+G+cmci3V/a4sy99ne76JbOOzpniv38UBdcM4IM8xYZPhXR AMpkAnsfEBI7mW4KO2eGYZlg2xmiZw2CB403lnP7c4sQ6g3Vdwp10BI4czVMfZse PclWsj7pZQxmNpMECRPaumpBd9YwgV7H2L+li4Azr6zUPzNUQYEN4gGsVRnqfC9M jMy3BIFSc+KmKjcw84uq4hQVw8ItfBO/1nNK1u+Fkcqyk0t/Z8leu1KKR0A2qAk+ +N8R4Uc8XEaGvA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefgddutddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepjeefrdel fedrkeegrddvtdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheprghlihhsthgrihhrsegrlhhishhtrghirhdvfedrmhgv X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (c-73-93-84-208.hsd1.ca.comcast.net [73.93.84.208]) by mail.messagingengine.com (Postfix) with ESMTPA id 0FD7A1080057; Thu, 21 Jan 2021 01:56:51 -0500 (EST) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, Alistair Francis Subject: [PATCH v2 5/6] touchscreen/wacom_i2c: Add support for vdd regulator Date: Wed, 20 Jan 2021 22:56:42 -0800 Message-Id: <20210121065643.342-6-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210121065643.342-1-alistair@alistair23.me> References: <20210121065643.342-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 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index a22570adc939..6d85a7bd0502 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 @@ -56,6 +57,7 @@ struct wacom_i2c { struct i2c_client *client; struct input_dev *input; struct touchscreen_properties props; + struct regulator *vdd; u8 data[WACOM_QUERY_SIZE]; bool prox; int tool; @@ -203,11 +205,29 @@ static int wacom_i2c_probe(struct i2c_client *client, struct wacom_features features = { 0 }; int error; + wac_i2c = kzalloc(sizeof(*wac_i2c), GFP_KERNEL); + if (!wac_i2c) + return -ENOMEM; + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { dev_err(&client->dev, "i2c_check_functionality error\n"); return -EIO; } + wac_i2c->vdd = regulator_get(&client->dev, "vdd"); + if (IS_ERR(wac_i2c->vdd)) { + error = PTR_ERR(wac_i2c->vdd); + kfree(wac_i2c); + return error; + } + + error = regulator_enable(wac_i2c->vdd); + if (error) { + regulator_put(wac_i2c->vdd); + kfree(wac_i2c); + return error; + } + error = wacom_query_device(client, &features); if (error) return error; @@ -276,6 +296,8 @@ static int wacom_i2c_probe(struct i2c_client *client, err_free_irq: free_irq(client->irq, wac_i2c); err_free_mem: + regulator_disable(wac_i2c->vdd); + regulator_put(wac_i2c->vdd); input_free_device(input); kfree(wac_i2c); -- 2.29.2