From patchwork Wed Sep 30 10:38:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Graeme Gregory X-Patchwork-Id: 54297 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id A05C622E23 for ; Wed, 30 Sep 2015 10:39:17 +0000 (UTC) Received: by wicmn1 with SMTP id mn1sf20061427wic.1 for ; Wed, 30 Sep 2015 03:39:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=XQEHlC2uViatIuK1UNOdJubFgSOY42fJRPl1kiP+GZk=; b=B3NGxOCSmgEByj7qODYU/G42BYTaipJ6ae99dOKIPmufnpbftP1DSxx7Ce8asg0RIm dU0wqSmWxwZZIqu3+7aA2efUvqJ1sI0eKToba98F9N/u/xglvX8nGmNsCeXbAIvMEDIY YeK1tHgk+aWn9z9Ffle4wehREPGvMSC+ddOqy47WR3O3zQbt64JcZsTol7Ywv/3EyXMQ w2lDyDMYiz4E+lo8F3huGGhDPomr+0lZ2TCSI3CixQ3+/2lJcZGOlCtj1XzB8eZfVVzi bkZvp+zSyZ5hb/trvvmiEC6NWHpkjxH7sVxVPQijzUxFeo3nnzpuKA7ZjRmQACWTtidm XvOA== X-Gm-Message-State: ALoCoQkUmm5G5R9f2fJC5VyqlRlqkx6bjQPCiprrcjoPK/Fjk1iNGMBMyV3kL4MIgFo69vCXYIz3 X-Received: by 10.112.209.73 with SMTP id mk9mr419196lbc.14.1443609556952; Wed, 30 Sep 2015 03:39:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.30.18 with SMTP id e18ls33029lfe.35.gmail; Wed, 30 Sep 2015 03:39:16 -0700 (PDT) X-Received: by 10.112.133.42 with SMTP id oz10mr910595lbb.62.1443609556723; Wed, 30 Sep 2015 03:39:16 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id rj9si214869lbb.26.2015.09.30.03.39.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Sep 2015 03:39:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by labzv5 with SMTP id zv5so40876742lab.1 for ; Wed, 30 Sep 2015 03:39:16 -0700 (PDT) X-Received: by 10.112.199.70 with SMTP id ji6mr923905lbc.73.1443609556588; Wed, 30 Sep 2015 03:39:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp2663653lbq; Wed, 30 Sep 2015 03:39:15 -0700 (PDT) X-Received: by 10.107.9.194 with SMTP id 63mr4274999ioj.122.1443609555692; Wed, 30 Sep 2015 03:39:15 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n2si20169747ige.66.2015.09.30.03.39.15; Wed, 30 Sep 2015 03:39:15 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755770AbbI3KjK (ORCPT + 30 others); Wed, 30 Sep 2015 06:39:10 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:38098 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755398AbbI3KjB (ORCPT ); Wed, 30 Sep 2015 06:39:01 -0400 Received: by wiclk2 with SMTP id lk2so55105396wic.1 for ; Wed, 30 Sep 2015 03:39:00 -0700 (PDT) X-Received: by 10.180.92.230 with SMTP id cp6mr28438908wib.80.1443609540013; Wed, 30 Sep 2015 03:39:00 -0700 (PDT) Received: from xora-haswell.xora.org.uk.xora.org.uk (host-92-22-69-126.as13285.net. [92.22.69.126]) by smtp.gmail.com with ESMTPSA id gh9sm544528wjb.27.2015.09.30.03.38.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Sep 2015 03:38:59 -0700 (PDT) From: Graeme Gregory To: linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, shannon.zhao@linaro.org, Graeme Gregory , "Rafael J. Wysocki" , Len Brown , Russell King , Greg Kroah-Hartman Subject: [PATCH 3/3] serial: amba-pl011: add ACPI support to AMBA probe Date: Wed, 30 Sep 2015 11:38:50 +0100 Message-Id: <1443609530-21524-4-git-send-email-graeme.gregory@linaro.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1443609530-21524-1-git-send-email-graeme.gregory@linaro.org> References: <1443609530-21524-1-git-send-email-graeme.gregory@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: graeme.gregory@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In ACPI this device is only defined in SBSA mode so if we are probing from ACPI use this mode. Cc: Rafael J. Wysocki Cc: Len Brown Cc: Russell King Cc: Greg Kroah-Hartman Signed-off-by: Graeme Gregory --- drivers/tty/serial/amba-pl011.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index fd27e98..55209aa 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -2368,18 +2368,28 @@ 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); + /* ACPI only defines SBSA variant */ + if (!ACPI_COMPANION(&dev->dev)) { + 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)); + } else { + uap->vendor = &vendor_sbsa; + uap->fifosize = 32; + uap->port.ops = &sbsa_uart_pops; + uap->fixed_baud = 115200; + + snprintf(uap->type, sizeof(uap->type), "SBSA"); + } uap->port.irq = dev->irq[0]; - uap->port.ops = &amba_pl011_pops; - - snprintf(uap->type, sizeof(uap->type), "PL011 rev%u", amba_rev(dev)); ret = pl011_setup_port(&dev->dev, uap, &dev->res, portnr); if (ret)