Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5981437ybe; Tue, 10 Sep 2019 11:41:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqxXAgqAHQgMwDaq7ul9DsoeyEi8IQZ8nAX9z1nh5ek+nlx0JMM0rf50oGUYVxGBIHYdA+G/ X-Received: by 2002:aa7:d40c:: with SMTP id z12mr32466987edq.30.1568140894349; Tue, 10 Sep 2019 11:41:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568140894; cv=none; d=google.com; s=arc-20160816; b=r8B+CBu8VoRgRKDlpd+axu4n22EUJsKn63BG4xc4D/kyAlqfMUOG+3NSomg6QfyZPf RPFdRK40umlvjOy6nC1dE1IleIazrJBqg1siJQVagNnDAd8lW3Tpsg4K7CHCoihrVW41 1yuELBpbP7eruIxAmTyHjjzPtMRyB+60Q7ghWS2Y+pkfFh852Pe3pksfJg72YvjTzeij R9xN6ERmqGxNFeU7diysG7bCOLW/WYSnbkdQ32MVVWTlnC5FuwQSGcdoI1TB1/SbyIc0 /IebyxghvsmcDHEYaj6SRiu6xKPJsUBKmznc1btqcsZjb7J5zDxzlHucPv8BzfXndbqu 3gVQ== 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=SZBXQ00kNv5NQovJGKh+u+MPP4U819vdiwc4HnF4pCg=; b=XpcquXdfEkx7Ww4XN1P2dDNRMr4RIg03F7ntxNeGJAjqpKaOGs3thcL4/pnxMoYWDH 1cjpG4OEgUCZRPOKUC6rJ+iCykrhnIb/dimQCMIj5ZrhmXw3w9SOb6acpY06k7+x/0Z0 iATXkHbORhOCeZV/54VelOFwrDK+ifvn7OGdeQaKveAMBrL0wt2PsUK/qKMGit3ALxyM u701D6jN8ccpiOMh4m7Y2W4ECMSrACPYmkQ7kHm64ZL7A5IeX8AS8rx2+HxK/4cv2bFK oJfmeIpNdGTAkPdiQ8Ug1a6sNjmFqT34sYejbXr/7dMh99EcCF+DNsqLeUJy392OMYz0 BiQw== 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 m6si10965647edv.288.2019.09.10.11.41.10; Tue, 10 Sep 2019 11:41:34 -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 S2391879AbfIIVpE (ORCPT + 99 others); Mon, 9 Sep 2019 17:45:04 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:54111 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726804AbfIIVpE (ORCPT ); Mon, 9 Sep 2019 17:45:04 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 46S1sp6MKWz1s5l4; Mon, 9 Sep 2019 23:45:02 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 46S1sp63JMz1qqkC; Mon, 9 Sep 2019 23:45:02 +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 sncZ18zW4FqX; Mon, 9 Sep 2019 23:45:01 +0200 (CEST) X-Auth-Info: 19V4OdvUc0SRvdsWsaLyf12pbobBcmDq27s6owue0HA= 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; Mon, 9 Sep 2019 23:45:01 +0200 (CEST) From: Lukasz Majewski To: Lee Jones Cc: linux-kernel@vger.kernel.org, Dmitry Torokhov , Sascha Hauer , Enrico Weigelt , Kate Stewart , linux-input@vger.kernel.org, Greg Kroah-Hartman , Lukasz Majewski Subject: [PATCH v5 2/3] input: touchscreen mc13xxx: Make platform data optional Date: Mon, 9 Sep 2019 23:44:39 +0200 Message-Id: <20190909214440.30674-3-lukma@denx.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190909214440.30674-1-lukma@denx.de> References: <20190909214440.30674-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 v5: - None 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.20.1