Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp219625imm; Thu, 21 Jun 2018 17:06:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKjSPyy/cXG1znHDJKTjfDECic+d8C+ap83eHsc1b9bXOM0dXbIdJkQuNiIirn7p+aMKNVI X-Received: by 2002:a62:fcb:: with SMTP id 72-v6mr29398858pfp.231.1529625961501; Thu, 21 Jun 2018 17:06:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529625961; cv=none; d=google.com; s=arc-20160816; b=pad8ctNCklYWeZ40oRSfQivzpJOAyXwwJU9mlm7Z6+2w5pqgs/rTVfEJjgMbYDar9G kgBb6DUPv71ofzXSrTFqDMbac6dZd9+6cCke3u8zfJcR949KE4ZMPaLIV6uDMG9sg4E6 tPfyKRCvTRndcF409zLCAf1jjUU6LnJp+gTOqq0wqzEciHBGrE8B+eM8JOmiDIF33dS0 Ho/bA8ycNXIdAIPZ27If2HVAbZPKnZe2Nz2AhHqr6jz+Mi6ZbaGWVVzR+imMT8m0QDYS ldIXKZjksJ0u01YYNGhEnlnmUkwqWQwQKTXLkXm8qf9D2H7sCqa1q8m54elqdHN8o9VO jQUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=7oK9t2F3dsGOZfcb7IUaGxaob3bTdz+ztOaX/m2wKlM=; b=B6PTRuXpALeunLCCnRl78SNIx5cV72EAYZbHLLX5ucJmcEhcvFOQlHK9lRnpXXN6JG Ri1mmr2Ho5fMnMPOqiBXGWxsLpepc4MdReonlUs28UUlaZ6Zov1+EhBtCGNf51rlzSE2 yzsAC5DECve7jlM703bHuo2vJGHWmrssSWo8vprSjsIE/sUQ+inzKWDM7EWBxK1iHLFU /yQJjWt8EJMZi1xcp5LxlchNEe92hdyM8CmOilNDWLogpnL/rUMAMhsIH6wCVqxrzHS+ SgjvK78owiSJjy+KrJK1MdEdtuMnZInXzSxsYwygH0TCkeute+d95MraG6MjicgVXtOD nnuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=F6NhRDRt; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v1-v6si3720444pga.510.2018.06.21.17.05.46; Thu, 21 Jun 2018 17:06:01 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=F6NhRDRt; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933846AbeFVAFI (ORCPT + 99 others); Thu, 21 Jun 2018 20:05:08 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:38875 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933129AbeFVAFG (ORCPT ); Thu, 21 Jun 2018 20:05:06 -0400 Received: by mail-pl0-f67.google.com with SMTP id d10-v6so2518406plo.5; Thu, 21 Jun 2018 17:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7oK9t2F3dsGOZfcb7IUaGxaob3bTdz+ztOaX/m2wKlM=; b=F6NhRDRtKO46Wdg5N1KQpoTt0FC6N26Scch2kKhVMnwOhdhX8HaLfMpfNc0DaMlXSJ 5PN3nTFBC1GkXjW76D5v2l0MVpsiBsECehmPLoKgpNiUKn/VfwfTbdcaqrvbMsUoaQc8 vbJDS4JpvN+Dak8VwWwmozWuvMT9EzaBrCbmMADGX/hWzHE5FHN/3MDuu1mPtCrQuiFR P0G2lBd7QBPmqdYX38MJ+jN/KmFwPBzZP/HZIDfT3DeXvZTN2+1FIabEWr08o8et5C9J uikdrMVJf3FpexSt6LnLf/HPdV7p7BfNETjIvtBaA7Wns/VBwDBwcjOj8BQe3FVeXKHS 8zYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7oK9t2F3dsGOZfcb7IUaGxaob3bTdz+ztOaX/m2wKlM=; b=oDGTUHo7d4PMhN6teG1b19HK87VdbZWXCHVOJu7JsTo6BpZeJ3kAy7VBuqpQS/Ptdb MtbhKoBnsfuZPaemo5YdJBo7nnbaQwpr+Gjr1yZDvSisXbVo9WNxTHrCvs5AKpbWxHnD iFbh7JmPV+7+F1h4sXC4lgHQGXdNj/qFlIhMnZ/vE0EBkIOfElBCzTLHJzAV3Bg6XlBN od4l2gYchm0hUv4o6BE8zqiNsHfqmkbdSv4an4SZOmcPCGCk1XMGlEhQW6AY5cPG8hZm mZ5SsrGfzz5kWfps1S21TJ10cQOzB61jp8XoxfMCExfwHPLTdiV6Swt9E5kc8AF8h/Yj 878A== X-Gm-Message-State: APt69E1o2HqP0z2PbVpAXMUrx4h/V/y3pwikgn14jPcThKkWtmXhRz12 J08eTs2P/gGvik6jQdYCEZM= X-Received: by 2002:a17:902:7048:: with SMTP id h8-v6mr30696049plt.269.1529625905251; Thu, 21 Jun 2018 17:05:05 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1511:8de6:27a8:ed13:2ef5]) by smtp.gmail.com with ESMTPSA id t68-v6sm10241636pfe.91.2018.06.21.17.05.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Jun 2018 17:05:04 -0700 (PDT) Date: Thu, 21 Jun 2018 17:05:02 -0700 From: Dmitry Torokhov To: Janusz Krzysztofik Cc: Tony Lindgren , Aaro Koskinen , "David S . Miller " , Mauro Carvalho Chehab , Greg Kroah-Hartman , Andrew Morton , Randy Dunlap , Linus Walleij , Mark Brown , Liam Girdwood , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-input@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 02/10] Input: ams_delta_serio: convert to platform driver Message-ID: <20180622000502.GA79890@dtor-ws> References: <20180609140224.32606-1-jmkrzyszt@gmail.com> <20180621224128.17623-1-jmkrzyszt@gmail.com> <20180621224128.17623-2-jmkrzyszt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180621224128.17623-2-jmkrzyszt@gmail.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 22, 2018 at 12:41:20AM +0200, Janusz Krzysztofik wrote: > Convert the driver to an "ams-delta-serio" platform driver. For it to > be used with Amstrad Delta, register an "ams-delta-serio" platform > device from the board init file. > > Signed-off-by: Janusz Krzysztofik > --- > Changelog: > v2: rebased on v4.18-rc1, no conflicts Input bits look good to me. Acked-by: Dmitry Torokhov > > arch/arm/mach-omap1/board-ams-delta.c | 6 ++++++ > drivers/input/serio/ams_delta_serio.c | 34 +++++++++++++++++++++------------- > 2 files changed, 27 insertions(+), 13 deletions(-) > > diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c > index 18e0ff437b27..2119d2d3ba84 100644 > --- a/arch/arm/mach-omap1/board-ams-delta.c > +++ b/arch/arm/mach-omap1/board-ams-delta.c > @@ -504,12 +504,18 @@ static struct platform_device cx20442_codec_device = { > .id = -1, > }; > > +static struct platform_device ams_delta_serio_device = { > + .name = "ams-delta-serio", > + .id = PLATFORM_DEVID_NONE, > +}; > + > static struct platform_device *ams_delta_devices[] __initdata = { > &latch1_gpio_device, > &latch2_gpio_device, > &ams_delta_kp_device, > &ams_delta_camera_device, > &ams_delta_audio_device, > + &ams_delta_serio_device, > }; > > static struct platform_device *late_devices[] __initdata = { > diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c > index 3df501c3421b..a2a7fa19bf49 100644 > --- a/drivers/input/serio/ams_delta_serio.c > +++ b/drivers/input/serio/ams_delta_serio.c > @@ -22,15 +22,17 @@ > */ > #include > #include > +#include > #include > #include > #include > > -#include > #include > > #include > > +#define DRIVER_NAME "ams-delta-serio" > + > MODULE_AUTHOR("Matt Callow"); > MODULE_DESCRIPTION("AMS Delta (E3) keyboard port driver"); > MODULE_LICENSE("GPL"); > @@ -126,13 +128,10 @@ static const struct gpio ams_delta_gpios[] __initconst_or_module = { > }, > }; > > -static int __init ams_delta_serio_init(void) > +static int ams_delta_serio_init(struct platform_device *pdev) > { > int err; > > - if (!machine_is_ams_delta()) > - return -ENODEV; > - > ams_delta_serio = kzalloc(sizeof(struct serio), GFP_KERNEL); > if (!ams_delta_serio) > return -ENOMEM; > @@ -142,22 +141,22 @@ static int __init ams_delta_serio_init(void) > ams_delta_serio->close = ams_delta_serio_close; > strlcpy(ams_delta_serio->name, "AMS DELTA keyboard adapter", > sizeof(ams_delta_serio->name)); > - strlcpy(ams_delta_serio->phys, "GPIO/serio0", > + strlcpy(ams_delta_serio->phys, dev_name(&pdev->dev), > sizeof(ams_delta_serio->phys)); > + ams_delta_serio->dev.parent = &pdev->dev; > > err = gpio_request_array(ams_delta_gpios, > ARRAY_SIZE(ams_delta_gpios)); > if (err) { > - pr_err("ams_delta_serio: Couldn't request gpio pins\n"); > + dev_err(&pdev->dev, "Couldn't request gpio pins\n"); > goto serio; > } > > err = request_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), > ams_delta_serio_interrupt, IRQ_TYPE_EDGE_RISING, > - "ams-delta-serio", 0); > + DRIVER_NAME, 0); > if (err < 0) { > - pr_err("ams_delta_serio: couldn't request gpio interrupt %d\n", > - gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK)); > + dev_err(&pdev->dev, "IRQ request failed (%d)\n", err); > goto gpio; > } > /* > @@ -179,13 +178,22 @@ static int __init ams_delta_serio_init(void) > kfree(ams_delta_serio); > return err; > } > -module_init(ams_delta_serio_init); > > -static void __exit ams_delta_serio_exit(void) > +static int ams_delta_serio_exit(struct platform_device *pdev) > { > serio_unregister_port(ams_delta_serio); > free_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 0); > gpio_free_array(ams_delta_gpios, > ARRAY_SIZE(ams_delta_gpios)); > + > + return 0; > } > -module_exit(ams_delta_serio_exit); > + > +static struct platform_driver ams_delta_serio_driver = { > + .probe = ams_delta_serio_init, > + .remove = ams_delta_serio_exit, > + .driver = { > + .name = DRIVER_NAME > + }, > +}; > +module_platform_driver(ams_delta_serio_driver); > -- > 2.16.4 > -- Dmitry