Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp17977ybi; Tue, 16 Jul 2019 15:21:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXQZIdJEsHs1M2EglUDlTixeVw/t+hP9zvfTQFaRBUQNr7UAjfhtHVIcK6D04GovTnC2KW X-Received: by 2002:a17:902:2be6:: with SMTP id l93mr39006815plb.0.1563315703082; Tue, 16 Jul 2019 15:21:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563315703; cv=none; d=google.com; s=arc-20160816; b=Zm8a9I62W7bf2HUqzfE1TM3+eF8702girgxjGKO6GiSoB70rdYyb2jDpzEBuGnLn/w mZX2ZafGVHXgxoJMUUeKm1MOe2+jRqxHdFp7vJQACSI1DYjnC7obCvuBkmBu+yxVhPg9 WbkxNrgpJ2vM6t/oSpaN4uL2Mb/mgAVL31pRKCKesZz1WvGcOmal2QtOzfWGlHzPvH5e K52c+GCX3npyeR/5vRN2fo5Q7RJbYSmdtt/t/Kb+dkW43rfJ8FYV8bCBV5cFRG853x6U rngQKbHvfGoOQnj9foKToQz6ezeo9f8IIWIGzRrO63RbIcWbqbRGkmCMGy6OLT7ESVbm 4Y5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=lIHK8wMaJTYQFuIMTOp7W/P16l+gYMT6VT0va38W7rE=; b=bRwvVMJzE7KHMOnmVzALfHCPNrW+e+uktbsVXeOoykt39+YdkdTzLjRIDYJsc48WOm WSmkZjL79V5oRJ0a7K2UsURtwQiO3fjvDiQhZOoKp5/OKsDyYHIwUZ/JKxShJQxSAPa5 FsGn+IAdM6l8YWxPiLqDPuz7KcSWXyDUUGN2xr00BNAyc7C9O5ivO+I3lmZ/9bOoLgUe hNFpA+G1FyU2q98+1+9+KqSVFHClUDvJbNRB2rx8rB9EZKZ9Z4Hwj6ehOYTi9p3q7rgc fYtp/EzKDw6mZJBCoj9FeN0DavX/DtlUd/++/uzAE25crwFJemQ7fAyZEtxxdet11d/G 3A1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 72si20328824plb.177.2019.07.16.15.21.26; Tue, 16 Jul 2019 15:21:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388133AbfGPWTv (ORCPT + 99 others); Tue, 16 Jul 2019 18:19:51 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:32889 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728434AbfGPWTu (ORCPT ); Tue, 16 Jul 2019 18:19:50 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 45pFFJ1hyLz1rQBH; Wed, 17 Jul 2019 00:19:48 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 45pFFJ0tX3z1qqkK; Wed, 17 Jul 2019 00:19:48 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id ASqV7A1V3OQh; Wed, 17 Jul 2019 00:19:46 +0200 (CEST) X-Auth-Info: uzbGUWK8URXUFpfJ4TakPszVyPECS0f33Ot+qYOxbiQ= Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 17 Jul 2019 00:19:46 +0200 (CEST) From: Lukasz Majewski To: Lee Jones Cc: linux-kernel@vger.kernel.org, Dmitry Torokhov , Sascha Hauer , Enrico Weigelt , Thomas Gleixner , Kate Stewart , linux-input@vger.kernel.org, Lukasz Majewski Subject: [PATCH v3 2/3] input: touchscreen mc13xxx: Make platform data optional Date: Wed, 17 Jul 2019 00:19:28 +0200 Message-Id: <20190716221929.3782-3-lukma@denx.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190716221929.3782-1-lukma@denx.de> References: <20190716221929.3782-1-lukma@denx.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sascha Hauer The platform data once was optional, make it optional again. This is a first step towards device tree support for the mc13xxx touchscreen driver. Signed-off-by: Sascha Hauer Signed-off-by: Lukasz Majewski --- Changes for v3: - None Changes for v2: - None Changes from the original patch: - Commit message typo fixes --- drivers/input/touchscreen/mc13783_ts.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/input/touchscreen/mc13783_ts.c b/drivers/input/touchscreen/mc13783_ts.c index ae0d978c83bf..edd49e44e0c9 100644 --- a/drivers/input/touchscreen/mc13783_ts.c +++ b/drivers/input/touchscreen/mc13783_ts.c @@ -35,7 +35,8 @@ struct mc13783_ts_priv { struct mc13xxx *mc13xxx; struct delayed_work work; unsigned int sample[4]; - struct mc13xxx_ts_platform_data *touch; + u8 ato; + bool atox; }; static irqreturn_t mc13783_ts_handler(int irq, void *data) @@ -125,7 +126,7 @@ static void mc13783_ts_work(struct work_struct *work) if (mc13xxx_adc_do_conversion(priv->mc13xxx, mode, channel, - priv->touch->ato, priv->touch->atox, + priv->ato, priv->atox, priv->sample) == 0) mc13783_ts_report_sample(priv); } @@ -169,6 +170,7 @@ static void mc13783_ts_close(struct input_dev *dev) static int __init mc13783_ts_probe(struct platform_device *pdev) { struct mc13783_ts_priv *priv; + struct mc13xxx_ts_platform_data *pdata = dev_get_platdata(&pdev->dev); struct input_dev *idev; int ret = -ENOMEM; @@ -180,11 +182,10 @@ static int __init mc13783_ts_probe(struct platform_device *pdev) INIT_DELAYED_WORK(&priv->work, mc13783_ts_work); priv->mc13xxx = dev_get_drvdata(pdev->dev.parent); priv->idev = idev; - priv->touch = dev_get_platdata(&pdev->dev); - if (!priv->touch) { - dev_err(&pdev->dev, "missing platform data\n"); - ret = -ENODEV; - goto err_free_mem; + + if (pdata) { + priv->atox = pdata->atox; + priv->ato = pdata->ato; } idev->name = MC13783_TS_NAME; -- 2.11.0