From patchwork Thu Dec 10 21:19:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loc Ho X-Patchwork-Id: 7822401 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 589BEBEEE1 for ; Thu, 10 Dec 2015 21:21:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 784B3205DD for ; Thu, 10 Dec 2015 21:21:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B0891205DC for ; Thu, 10 Dec 2015 21:21:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a78d6-0005eU-ES; Thu, 10 Dec 2015 21:20:00 +0000 Received: from mail-oi0-x236.google.com ([2607:f8b0:4003:c06::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a78cv-0005Yq-87 for linux-arm-kernel@lists.infradead.org; Thu, 10 Dec 2015 21:19:50 +0000 Received: by oixx65 with SMTP id x65so53817652oix.0 for ; Thu, 10 Dec 2015 13:19:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apm.com; s=apm; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3XQbyVI7cMoqwlY48GeACQWsOEpx4vatghbpjwWZjpU=; b=cZ+s89ii5L0O4xsjXsVeiz88tJm4ULMiSEwTOFF/a/0Timn0A9AwSUpjYW0uyCvuhk mdowip667wmxbN8wyKv4T46W5GTjC8n7t2BaEmiKR40CKp8p0N6fQktH6bCZas5Z+4pP 8kFN2P2jeXZ2ZtZzCt1pQJNKDRmBHvIRK6Uqw= 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=3XQbyVI7cMoqwlY48GeACQWsOEpx4vatghbpjwWZjpU=; b=HVDMxEMijsAB5sKpf3JZpYyEe9gP+nM+gHwz4xvD7t2QDhY630dCoVnOT0xQ2x5jNa XGE662lGH8FD3tibta68JhNAq2gCl467+i/rEFNlLhM3nwgN2ZynMM6F16Y+ZF7oDofI 6w1OUd5gYn0E6GfZd7gUjrNgIO8Ez3bMHQOKQmebpf5XWJshkCWL0HDtJ6eAt0xbMSMH ByIKFziBQP3M+PVVAz3KTXE79lK1tJ0mzW2fMq4IknP9kXnVKugK5oTnJwX7LHaCieyZ knBdzLXIbJWzD6X+CfUPVMCFqkru/ZDR4aYIv4uCtmyeHqy/xB5r4L/kcHwddihKcdSS zwgQ== X-Gm-Message-State: ALoCoQkhFOIib+e6cJr4Xl/0eIoGesCL1RtNV7r0KO8v0mgrDoVtp59QxX4+j3Qp0yvMmNOPk83xN4UxPUnycbuN6F6Bdbppzw== X-Received: by 10.202.72.132 with SMTP id v126mr10798357oia.84.1449782368396; Thu, 10 Dec 2015 13:19:28 -0800 (PST) Received: from localhost.localdomain ([198.137.200.11]) by smtp.gmail.com with ESMTPSA id gi5sm6714204obb.6.2015.12.10.13.19.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Dec 2015 13:19:27 -0800 (PST) From: Loc Ho To: wsa@the-dreams.de, Ken.Xue@amd.com, Jeff.Wu@amd.com, rjw@rjwysocki.net, mika.westerberg@linux.intel.com, lenb@kernel.org Subject: [PATCH v2 1/2] acpi:apd: Add APM X-Gene ACPI I2C device support Date: Thu, 10 Dec 2015 14:19:16 -0700 Message-Id: <1449782357-22982-2-git-send-email-lho@apm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1449782357-22982-1-git-send-email-lho@apm.com> References: <1449782357-22982-1-git-send-email-lho@apm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151210_131949_505958_786AAEE2 X-CRM114-Status: GOOD ( 15.08 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jcm@redhat.com, patches@apm.com, linux-acpi@vger.kernel.org, Loc Ho , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add APM X-Gene ACPI I2C device support by hooks into existent ACPI apd driver. To fully enable support, require another patch to add the X-Gene ACPI node into the DW I2C driver. Signed-off-by: Loc Ho Reviewed-by: Ken Xue --- drivers/acpi/acpi_apd.c | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c index a450e7a..d507cf6 100644 --- a/drivers/acpi/acpi_apd.c +++ b/drivers/acpi/acpi_apd.c @@ -51,7 +51,7 @@ struct apd_private_data { const struct apd_device_desc *dev_desc; }; -#ifdef CONFIG_X86_AMD_PLATFORM_DEVICE +#if defined(CONFIG_X86_AMD_PLATFORM_DEVICE) || defined(CONFIG_ARM64) #define APD_ADDR(desc) ((unsigned long)&desc) static int acpi_apd_setup(struct apd_private_data *pdata) @@ -71,6 +71,7 @@ static int acpi_apd_setup(struct apd_private_data *pdata) return 0; } +#ifdef CONFIG_X86_AMD_PLATFORM_DEVICE static struct apd_device_desc cz_i2c_desc = { .setup = acpi_apd_setup, .fixed_clk_rate = 133000000, @@ -80,6 +81,14 @@ static struct apd_device_desc cz_uart_desc = { .setup = acpi_apd_setup, .fixed_clk_rate = 48000000, }; +#endif + +#ifdef CONFIG_ARM64 +static struct apd_device_desc xgene_i2c_desc = { + .setup = acpi_apd_setup, + .fixed_clk_rate = 100000000, +}; +#endif #else @@ -132,9 +141,14 @@ static int acpi_apd_create_device(struct acpi_device *adev, static const struct acpi_device_id acpi_apd_device_ids[] = { /* Generic apd devices */ +#ifdef CONFIG_X86_AMD_PLATFORM_DEVICE { "AMD0010", APD_ADDR(cz_i2c_desc) }, { "AMD0020", APD_ADDR(cz_uart_desc) }, { "AMD0030", }, +#endif +#ifdef CONFIG_ARM64 + { "APMC0D0F", APD_ADDR(xgene_i2c_desc) }, +#endif { } };