From patchwork Mon Jul 31 07:13:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yegor Yefremov X-Patchwork-Id: 9871117 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BCCBF6037D for ; Mon, 31 Jul 2017 07:13:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFC3827480 for ; Mon, 31 Jul 2017 07:13:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A487B28563; Mon, 31 Jul 2017 07:13:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41BDE27480 for ; Mon, 31 Jul 2017 07:13:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750923AbdGaHNs (ORCPT ); Mon, 31 Jul 2017 03:13:48 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33800 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750739AbdGaHNr (ORCPT ); Mon, 31 Jul 2017 03:13:47 -0400 Received: by mail-wm0-f66.google.com with SMTP id x64so10109109wmg.1; Mon, 31 Jul 2017 00:13:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2Wo6uCCa9g+JDQciVi8JaiVdpAqY0t8sW4Mjoiy4D4o=; b=Y3/cyMcKb2mwjHudZW1j8oNDpVxH1iYWa7i6V8Xq1iCu4cKYF7/4B05WiLh8yfl85E p/El/IiJAQbjLdSnBXHGOulv06vmMJVLrQrky/bZdxRyPdetL3+toB4A8RhyWGAdhdgF fU6i0tN1YJeTRlMmDdwD/sSOspFuBxtkslRIx0IDrDj55iLDmfA7fW0rY3CEgZS6wWXH I70nivo7oAOKKQ+AK8PrNF6HO335H0UDkjcFD2vfjrnHcFk2HhZj32i0sG9AC9xfIVOm NQBGsc7PnUbVA02A1a/Gk0w8c2OAlviNK6bucJWSGfzYDs+ymvYxLmnlmULI6floN3A/ 4A2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2Wo6uCCa9g+JDQciVi8JaiVdpAqY0t8sW4Mjoiy4D4o=; b=IuQkW7PlSoMIYiyysSNBSbLh2UXJKyApCjj5finLSG5ZusnMSDVU3bC215Gq1ZZUxL uoDgxVHVEKmRGkafwsz4F3blBmDjgYrAkz77JCU6a74RDmT0Sr3avhTUQAxvJlnkBO75 qYmjIxoXnFE+cvF3Dyyk1LEnMCj9ijlYAIyPHupY0eBLHnV/aEClk1DnKFqbAB2gDL0V 7WLN0EpwmK5Kg/l9if5mvyvt75fkyH4O5j82zN90bQUCl3v2SI5Y53pHk6F3T/xhsyF2 WIzDehVf0YOoukrSZNe+JLOM0puQxSw87NQBW0+O2Nb0oUMWFjL8DV1TImGz/AP72Bi3 Gdwg== X-Gm-Message-State: AIVw113OmWMEOU+aisCys8p+NQVT/THQ6r0VeZGC8Z281aS9OYRSjggr bjo+pEzh5Nt9gMIgDNI= X-Received: by 10.80.168.34 with SMTP id j31mr13734622edc.87.1501485225746; Mon, 31 Jul 2017 00:13:45 -0700 (PDT) Received: from development1.visionsystems.de (mail.visionsystems.de. [213.209.99.202]) by smtp.gmail.com with ESMTPSA id k1sm4766621eda.35.2017.07.31.00.13.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 31 Jul 2017 00:13:45 -0700 (PDT) From: yegorslists@googlemail.com To: linux-serial@vger.kernel.org Cc: gregkh@linuxfoundation.org, andriy.shevchenko@linux.intel.com, jslaby@suse.com, tony@atomide.com, robh@kernel.org, mika.westerberg@linux.intel.com, uwe@kleine-koenig.org, linux-omap@vger.kernel.org, devicetree@vger.kernel.org, julia.lawall@lip6.fr, peter@hurleysoftware.com, Yegor Yefremov Subject: [PATCH v2 1/3] serial: mctrl_gpio: restrict MCTRL initialization Date: Mon, 31 Jul 2017 09:13:21 +0200 Message-Id: <1501485203-13185-2-git-send-email-yegorslists@googlemail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1501485203-13185-1-git-send-email-yegorslists@googlemail.com> References: <1501485203-13185-1-git-send-email-yegorslists@googlemail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Yegor Yefremov GPIOs specified for serial port can be used either as GPIO driven MCTRL or as a wakeup-source. Use the latter property to abort the MCTRL initialization. Return -ENOSYS as this would just skip mctrl initialization in the case of wakeup source usage and not disable the port completely due to failed serial8250_register_8250_port(). Signed-off-by: Yegor Yefremov --- drivers/tty/serial/serial_mctrl_gpio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/tty/serial/serial_mctrl_gpio.c b/drivers/tty/serial/serial_mctrl_gpio.c index d2da6aa..dce661c 100644 --- a/drivers/tty/serial/serial_mctrl_gpio.c +++ b/drivers/tty/serial/serial_mctrl_gpio.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -118,6 +119,9 @@ struct mctrl_gpios *mctrl_gpio_init_noauto(struct device *dev, unsigned int idx) struct mctrl_gpios *gpios; enum mctrl_gpio_idx i; + if (device_property_present(dev, "wakeup-source")) + return ERR_PTR(-ENOSYS); + gpios = devm_kzalloc(dev, sizeof(*gpios), GFP_KERNEL); if (!gpios) return ERR_PTR(-ENOMEM);