From patchwork Mon Dec 21 14:49:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 58817 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp2648308lbb; Mon, 21 Dec 2015 06:52:32 -0800 (PST) X-Received: by 10.66.159.38 with SMTP id wz6mr27929179pab.12.1450709552664; Mon, 21 Dec 2015 06:52:32 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 86si7425054pfi.16.2015.12.21.06.52.32; Mon, 21 Dec 2015 06:52:32 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751728AbbLUOwb (ORCPT + 29 others); Mon, 21 Dec 2015 09:52:31 -0500 Received: from mail-lb0-f172.google.com ([209.85.217.172]:34983 "EHLO mail-lb0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751929AbbLUOwF (ORCPT ); Mon, 21 Dec 2015 09:52:05 -0500 Received: by mail-lb0-f172.google.com with SMTP id bc4so16519051lbc.2 for ; Mon, 21 Dec 2015 06:52:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LENWXumG5Uc6zQ8Yu1zwH+hBjqvAWNaIOhaYkhZhmfo=; b=Sj46kf/cMa2IELQy79c86AO9jhUthztxYiB8YPkuRKxpwtdEZKp1TWFuYURxLbQBKJ LovAL+UGn42Afykff9hq83Jk73rI8DTk+39eVssfghdrUxSXPgmVDXPlP1/f6XSKveZN n69/18C2mpsH20tFwmqBp7PKxoRvN6Wmq8s7o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LENWXumG5Uc6zQ8Yu1zwH+hBjqvAWNaIOhaYkhZhmfo=; b=ODMh0EIakar6co79U3gr9Es2X1RWVjH7u3BDMqgWu0pct+IZDBBiHcThwczsBfNV3j NtdAxaI4ickuA6SQhg6VpMT1PkFh3ub+pBTt25+xEx1fbtEE7GeMmGMwH3K0d0roqPVf jNYsA6wFmLQIb9QyRtiWUGTJ45HKOMro4sgRdTeZBkkoSNJyn7SC886HL1fSHAW9xpVb AYNqEoV2GLw2b0gRI7YTuSkXKYwwd3lGZvwl03TqLp0GZ5iUn5VDZoVnLktFSE7GeZUa i0ZjIfvYHzdDzmwAuYO3eawZizaQoC+CeSVK90pdlhTT8BDDW4wlcatVnXEtWTE39LM3 zVMw== X-Gm-Message-State: ALoCoQlGZBisff2sU3Z97mZCwybB6PDGXruHLnSSBqKQRrihK4vTK7mReRYV59RtM7Ry9aTLVmkmktstIUU3rfMwewi4d6Qfjg== X-Received: by 10.112.219.98 with SMTP id pn2mr6504469lbc.93.1450709524184; Mon, 21 Dec 2015 06:52:04 -0800 (PST) Received: from turnip.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id y15sm5061874lfd.3.2015.12.21.06.52.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Dec 2015 06:52:03 -0800 (PST) From: Aleksey Makarov To: linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Aleksey Makarov , Graeme Gregory , Russell King , Greg Kroah-Hartman , "Rafael J . Wysocki" , Shannon Zhao , Jiri Slaby Subject: [PATCH v2 3/3] serial: amba-pl011: add ACPI support to AMBA probe Date: Mon, 21 Dec 2015 17:49:57 +0300 Message-Id: <1450709399-7246-4-git-send-email-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1450709399-7246-1-git-send-email-aleksey.makarov@linaro.org> References: <1450709399-7246-1-git-send-email-aleksey.makarov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 899a771..766ce4f 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 (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; - snprintf(uap->type, sizeof(uap->type), "PL011 rev%u", amba_rev(dev)); + snprintf(uap->type, sizeof(uap->type), "SBSA"); + } else { + 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.ops = &amba_pl011_pops; + + snprintf(uap->type, sizeof(uap->type), "PL011 rev%u", + amba_rev(dev)); + } + uap->port.irq = dev->irq[0]; ret = pl011_setup_port(&dev->dev, uap, &dev->res, portnr); if (ret)