From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timur Tabi Subject: Re: [PATCH v4 3/3] serial: amba-pl011: add ACPI support to AMBA probe Date: Mon, 4 Jan 2016 17:13:08 -0600 Message-ID: References: <1450880383-29560-1-git-send-email-aleksey.makarov@linaro.org> <1450880383-29560-4-git-send-email-aleksey.makarov@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]:37590 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752012AbcADXNK (ORCPT ); Mon, 4 Jan 2016 18:13:10 -0500 In-Reply-To: <1450880383-29560-4-git-send-email-aleksey.makarov@linaro.org> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Aleksey Makarov Cc: linux-acpi@vger.kernel.org, Russell King , Graeme Gregory , Greg Kroah-Hartman , Andy Shevchenko , "Rafael J . Wysocki" , lkml , Vladimir Zapolskiy , Shannon Zhao , linux-serial@vger.kernel.org, Jiri Slaby , "linux-arm-kernel@lists.infradead.org" On Wed, Dec 23, 2015 at 8:19 AM, Aleksey Makarov wrote: > From: Graeme Gregory > > In ACPI this device is only defined in SBSA mode so > if we are coming from ACPI use this mode. > > Signed-off-by: Graeme Gregory > Signed-off-by: Aleksey Makarov > --- > drivers/tty/serial/amba-pl011.c | 37 ++++++++++++++++++++++++++----------- > 1 file changed, 26 insertions(+), 11 deletions(-) > > diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c > index 899a771..974cb9e 100644 > --- a/drivers/tty/serial/amba-pl011.c > +++ b/drivers/tty/serial/amba-pl011.c > @@ -2368,18 +2368,33 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) > if (!uap) > return -ENOMEM; > > - uap->clk = devm_clk_get(&dev->dev, NULL); > - if (IS_ERR(uap->clk)) > - return PTR_ERR(uap->clk); > - > - uap->vendor = vendor; > - uap->lcrh_rx = vendor->lcrh_rx; > - uap->lcrh_tx = vendor->lcrh_tx; > - uap->fifosize = vendor->get_fifosize(dev); > - uap->port.irq = dev->irq[0]; > - uap->port.ops = &amba_pl011_pops; > + /* ACPI only defines SBSA variant */ > + if (has_acpi_companion(&dev->dev)) { > + /* > + * According to ARM ARMH0011 is currently the only mapping > + * of pl011 in ACPI and it's mapped to SBSA UART mode > + */ > + uap->vendor = &vendor_sbsa; > + uap->fifosize = 32; > + uap->port.ops = &sbsa_uart_pops; > + uap->fixed_baud = 115200; I'm confused by this patch. We already have code like this in tty-next, in the form of sbsa_uart_probe(): https://kernel.googlesource.com/pub/scm/linux/kernel/git/gregkh/tty/+/tty-next/drivers/tty/serial/amba-pl011.c#2553 -- Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.