Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2841213pxf; Sun, 21 Mar 2021 08:41:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVO9rE7QlYSSjAh+O979HkeumB9nXNTsGOi7g9jgWUIEK/S72P8kjzt6mdWuNd4rES+iTb X-Received: by 2002:aa7:da14:: with SMTP id r20mr20861804eds.181.1616341276514; Sun, 21 Mar 2021 08:41:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616341276; cv=none; d=google.com; s=arc-20160816; b=n4x8c6rsRAMp05/7m6dgURLA7N31N3tS+4xD4Z+hBYkJcHmwcr71VT1DitGG6ZL8xM UHtgzon61UeVuT8dJJJ5b+T2FgTUnvJRQ9SXen/s5u6Jm/1VdhQLPqe4fODhDGXcvqZx +6xoOM0Yw9EE7nCjQ/ixvSkKQ7K06AQ0UCqliyow3SoXvEoLfaNpjlZeVXHmI+46/4uo vviI1myaRTCyn4fqOggMblCMraW22yASP0Vp6PHc0xDsG2iWSndfe3BeXmsswSodLcFA BKH0tzVEAoEiOzTSKKBOLZSJjY7v38GU61hxSWZKsHiCb9xS8ke7+QZzPsgOxd1rvqH/ EfRQ== 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=32flhDWiUNY2Vsj5ubaE1JFNCRDha2jAWNSmn4As7OM=; b=b6UlDv/Mw7U1A5QcD20qH36hYRLbSmUsm80bCDFZVpWn7/9cEB/ytczWpIumHoDnE6 Y5W+cge7zClUgsZbRa+E07+CO2k1wk61IB90Xrd9pjFYEGrxVXGH6bn/1AvsAYWuk32P xfhOp+XCStFkXTOW67yoUoIERmQTsMRH3MVa4tPyLNBx58sgiQUfWqNz29GIZwFgzCjw YHiwaAXX3KvkicV3IamlzyrmRYAzEO6/W/NLu6xZ+RigHVY94QZxCsn+qlCrFwhdGdMw TKKKM7NHr7eRKz8b1aJiFXprQiAa2bgTCycl3uJ3mQaCw2/CGoKd5lJxyXFzY1WP2rmc WAOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alistair23.me header.s=fm3 header.b=UQ9+vL0f; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=JGOyTmud; 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 qh28si9090804ejb.580.2021.03.21.08.40.53; Sun, 21 Mar 2021 08:41:16 -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=fm3 header.b=UQ9+vL0f; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=JGOyTmud; 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 S230112AbhCUOL0 (ORCPT + 99 others); Sun, 21 Mar 2021 10:11:26 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:42859 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229926AbhCUOLM (ORCPT ); Sun, 21 Mar 2021 10:11:12 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 6D4D85C00CB; Sun, 21 Mar 2021 10:11:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 21 Mar 2021 10:11:11 -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=fm3; bh=32flhDWiUNY2V sj5ubaE1JFNCRDha2jAWNSmn4As7OM=; b=UQ9+vL0f0OMKIxa5KeLtca8UogsEt Psnoy6ARArYlTXcYAXm0pAVCU3FbsaqHszT95/Uo6h6Li7V4lwhkbhrCDUKvlgDY 6uAMaO0mx1KlmcGnSPy67XZmF+5OtILdbkVEHhVkN7X0FAI9xDhZ46eFPbQwjDrJ 2jhx/brmvEK6W+t2Ljdf7Ay6T6YzbU/0PrZOTjo6c+z/Rjsk9ZjHuB8/U0w0bLyO d3e/+PSztcnIh3+I0RZi3WSZAM4YD2qAORb2xFOgQnezKe5u2QPq7AAQZaubNxfi f5CBZuwX+9D4wAzdn9KKmxGd/t/mUmRW1ES/4qTYKBfCqa6mr7QB+YNRA== 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= fm2; bh=32flhDWiUNY2Vsj5ubaE1JFNCRDha2jAWNSmn4As7OM=; b=JGOyTmud +NGm30J11LpS9tbe0DFVvbZTX8XpB5lax6aNfHJ8a01KxGKtwI9JUZ4aZQqAVj7M ySGMRXJPVUS7RUb6zxPtzlwoJlbUId236WOhQ62hGkPzMm9s47T6WCPxx+Cuk8/y h64wLrc1haRTm6rh2Qwm00PCvztXyVpnSZ/Z6A27o2qIcLcpR25GGVW0nQpBm5R8 zShKK7IFDbG4lqxvA0nAidQW6fwEgUsvGBWcjLozPs7rNdO71DtWWmeVWx7t+H/I F86Ghic1kZDRPw6XthGTJabF5FN1TWD4iuvd/zkTmEzSa6NgdMNnghY/lpgQgOA4 quUh6br5Jxy7Hg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegvddgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucfkphepudelfedr vdejrddufedrvdefheenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrih hlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdefrdhmvg X-ME-Proxy: Received: from ThinkpadX1Yoga3.localdomain (unknown [193.27.13.235]) by mail.messagingengine.com (Postfix) with ESMTPA id 79FD12400CC; Sun, 21 Mar 2021 10:11:10 -0400 (EDT) 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 v3 7/9] Input: wacom_i2c - Add support for vdd regulator Date: Sun, 21 Mar 2021 10:10:47 -0400 Message-Id: <20210321141049.148-8-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210321141049.148-1-alistair@alistair23.me> References: <20210321141049.148-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 7aa0d1c3dbc9..00db516fa3de 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; @@ -275,6 +295,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.30.1