Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1437633ybi; Wed, 17 Jul 2019 15:28:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2olSr5V/alMINGhPkUKQfLFoiRoPuOSfqWGXeG5ynycBYZCXDIOl1w3cgBgXrXf29MVCk X-Received: by 2002:a17:902:7781:: with SMTP id o1mr46139322pll.205.1563402509424; Wed, 17 Jul 2019 15:28:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563402509; cv=none; d=google.com; s=arc-20160816; b=mw1WVD2rl/UyleXDpT0MfCRS286gkG74peAvLlNtUzdWlluPSYZiP+NgvUpf9+elWy LDhN8uQgk3aN4SeFy7Zux1tgqDRzZsqKbvtwBJsaya3NjvSkKTkr7QQNctg2uN4a3D1q 7v686TLdA1rRReecjAxeyQ8DSA2fJabu4oxQilgH4dM5v9bcDcK9Z07th9qwi3hN46Ve Ak2V2MHmFWK6cUMyLVTWgWV76R6swkH0/3rDzL+OwCEN2taSn5rBnSp7ZH9clnpoygyU aHAbO0Yqzoo5yDpYpGAoPU3DUhVTsiOwXKPQaJBn4eM8EKWfllg9ekhSlcjhn0yYY24a HrNg== 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=KbEhbyPMvN5V8/OyFGMsHuur/wnbSVveekyY5Fd/eJU=; b=bunEHEQF4pBqAODnAkETEdbmwBBi1ywo6rf2DK+SYN7HILvkI/qeAEcC3yP99Ib7r2 sCVwHbhcgfcfnVU9dtX2tnnyig0BudvAwm8ajcyxL5JJFNieMlOSVpAxFXp5OKOxyvhI UCufcEN3ylW2yIAJd93U2P3j/+6ny8uJTTuOrFS3ms/SFpZ3k7rcH11t+BbRcn0PtMw4 iyacIuPlRq7nQWcS8aFEhlz0kp7A8g7dhkbrkmaNlq7rLut8XmcP3DoTyaPIX0VSD5Z5 tJgUrfkbqG0Qn8cfvLRpujK4IoLDKZmDQDXiDZDXZBGvYXWoFkPwrMWNpS7RWJI3YIri UxNQ== 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 f8si42024pfn.43.2019.07.17.15.28.13; Wed, 17 Jul 2019 15:28:29 -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 S1729962AbfGQW0d (ORCPT + 99 others); Wed, 17 Jul 2019 18:26:33 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:50708 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727106AbfGQW0c (ORCPT ); Wed, 17 Jul 2019 18:26:32 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 45psLZ65jsz1rJhX; Thu, 18 Jul 2019 00:26:30 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 45psLZ53dYz1qqkw; Thu, 18 Jul 2019 00:26:30 +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 B9NlzxDbVMh1; Thu, 18 Jul 2019 00:26:29 +0200 (CEST) X-Auth-Info: vvr2+glzC/hB5ATNDEgEN9uhALRIyYHsR650OZoKZ/I= 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; Thu, 18 Jul 2019 00:26:29 +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 v4 2/3] input: touchscreen mc13xxx: Make platform data optional Date: Thu, 18 Jul 2019 00:26:01 +0200 Message-Id: <20190717222602.2912-3-lukma@denx.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190717222602.2912-1-lukma@denx.de> References: <20190717222602.2912-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 Acked-by: Dmitry Torokhov --- Changes for v4: - Add Dmitry's Acked-by: 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