From patchwork Mon Aug 22 14:24:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heikki Krogerus X-Patchwork-Id: 9293623 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 0970B607FF for ; Mon, 22 Aug 2016 14:24:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1E4A289F6 for ; Mon, 22 Aug 2016 14:24:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E666928A02; Mon, 22 Aug 2016 14:24:24 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 28DC5289F6 for ; Mon, 22 Aug 2016 14:24:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755894AbcHVOYW (ORCPT ); Mon, 22 Aug 2016 10:24:22 -0400 Received: from mga11.intel.com ([192.55.52.93]:6663 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755774AbcHVOYV (ORCPT ); Mon, 22 Aug 2016 10:24:21 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 22 Aug 2016 07:24:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,560,1464678000"; d="scan'208";a="869329952" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.56]) by orsmga003.jf.intel.com with ESMTP; 22 Aug 2016 07:24:19 -0700 From: Heikki Krogerus To: Greg Kroah-Hartman , "Rafael J. Wysocki" Cc: Andy Shevchenko , Kefeng Wang , linux-serial@vger.kernel.org, linux-acpi@vger.kernel.org, Ken Xue Subject: [PATCH 1/3] ACPI / APD: Provide build-in properties of the UART Date: Mon, 22 Aug 2016 17:24:13 +0300 Message-Id: <1471875855-110782-2-git-send-email-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1471875855-110782-1-git-send-email-heikki.krogerus@linux.intel.com> References: <1471875855-110782-1-git-send-email-heikki.krogerus@linux.intel.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The UART driver, dw8250.c, needs some details regarding the Designware UART. For ACPI enumerated devices the values are hard-coded, but since the driver also reads the values from device properties, providing them with build-in properties. This allows us to later remove the hard-coded values from the driver. Signed-off-by: Heikki Krogerus Cc: Ken Xue --- drivers/acpi/acpi_apd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c index c80c8f8..a51dbef 100644 --- a/drivers/acpi/acpi_apd.c +++ b/drivers/acpi/acpi_apd.c @@ -42,6 +42,7 @@ struct apd_private_data; struct apd_device_desc { unsigned int flags; unsigned int fixed_clk_rate; + struct property_entry *properties; int (*setup)(struct apd_private_data *pdata); }; @@ -67,6 +68,9 @@ static int acpi_apd_setup(struct apd_private_data *pdata) pdata->clk = clk; } + if (pdata->properties) + return device_add_properties(&pdata->adev->dev, + pdata->properties); return 0; } @@ -76,9 +80,17 @@ static struct apd_device_desc cz_i2c_desc = { .fixed_clk_rate = 133000000, }; +static struct property_entry uart_properties[] = { + PROPERTY_ENTRY_U32("reg-io-width", 4), + PROPERTY_ENTRY_U32("reg-shift", 2), + PROPERTY_ENTRY_BOOL("snps,uart-16550-compatible"), + { }, +}; + static struct apd_device_desc cz_uart_desc = { .setup = acpi_apd_setup, .fixed_clk_rate = 48000000, + .properties = uart_properties, }; #endif