From patchwork Mon Dec 21 16:41:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 58820 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp2715252lbb; Mon, 21 Dec 2015 08:45:09 -0800 (PST) X-Received: by 10.98.64.77 with SMTP id n74mr28619252pfa.141.1450716294663; Mon, 21 Dec 2015 08:44:54 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r76si3781808pfa.243.2015.12.21.08.44.54; Mon, 21 Dec 2015 08:44:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-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-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-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 S1751624AbbLUQov (ORCPT + 6 others); Mon, 21 Dec 2015 11:44:51 -0500 Received: from mail-lf0-f49.google.com ([209.85.215.49]:36316 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751448AbbLUQn6 (ORCPT ); Mon, 21 Dec 2015 11:43:58 -0500 Received: by mail-lf0-f49.google.com with SMTP id z124so109701626lfa.3 for ; Mon, 21 Dec 2015 08:43:57 -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=VFLUKr1xDZkckOJksTkcpSbpQ/W8biwpxPu2HNyDBwA1Np+M1QuNaBpNJOnrgQJb2k 0zOLJ+WIKwtq5oiCybp6ZTV+aOYr2cDUouEYiJPjMJ8nEODYRqWziRTH3JKM5RAyOqeZ RHNJFtV/iBxV/ZlMVKcwGrQ6/Sj724rroIMxU= 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=jngRiw2V3xOw1n+SuOjZfZSe/5clyPBL3vbyxfr1saTMTPzCFlnt0bEzabjwdf89Cx 8kexav2510TGadbf9x6ipSB075cMTVQca66n6ySrWgS7U3qRiZZ7TNBj/qZ9VrDxIKlg 7C5ZPSoDVdcaSLS5xjBHQO1BkHy2i36n/QPRQ7/U2qsNsTM43v54yQxmDzlgnaadl+y2 zQSZ1poItHf6cL0m0QdBARK1MGy+3LxzdFwA/N06v5MDZ4sGJ3l2T199Gao7X1PDprSh 8tYNOchllqlfD4mN1m5GdKVc2Luk7w46RMfgoz/XYAbniyYZBCLS8zjUfn808lSQBge0 cjuA== X-Gm-Message-State: ALoCoQmIUZ/a4E7wHZEdfSpFBa1REhKnWmNbFVQhTKraso0X/weKlTGTCNkm95OKWgiu1gUK4u4XqiwQIDlBXNGocPu+hF0cyQ== X-Received: by 10.25.84.72 with SMTP id i69mr5791571lfb.81.1450716237037; Mon, 21 Dec 2015 08:43:57 -0800 (PST) Received: from turnip.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id xt2sm4970674lbb.47.2015.12.21.08.43.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Dec 2015 08:43:56 -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 v3 3/3] serial: amba-pl011: add ACPI support to AMBA probe Date: Mon, 21 Dec 2015 19:41:38 +0300 Message-Id: <1450716100-13688-4-git-send-email-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1450716100-13688-1-git-send-email-aleksey.makarov@linaro.org> References: <1450716100-13688-1-git-send-email-aleksey.makarov@linaro.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@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-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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)