From patchwork Wed Aug 13 19:59:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 4720591 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A20FFC0338 for ; Wed, 13 Aug 2014 20:01:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A51D4201ED for ; Wed, 13 Aug 2014 20:01:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B36B52016C for ; Wed, 13 Aug 2014 20:01:36 +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 1XHeiG-0004AP-V7; Wed, 13 Aug 2014 20:00:00 +0000 Received: from mail-la0-x230.google.com ([2a00:1450:4010:c03::230]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XHei8-0003zP-Ry for linux-arm-kernel@lists.infradead.org; Wed, 13 Aug 2014 19:59:53 +0000 Received: by mail-la0-f48.google.com with SMTP id gl10so201473lab.7 for ; Wed, 13 Aug 2014 12:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oagtiVL6cEqAt5WtnQxULfi6bnZa4gRogvs/jD1j3y4=; b=Jvk4UkD9Xx1Vyp62ztHMgi+O5ZxAQIFHWGlfvWlhdDAwzzmjQZzc4jGtXzQIlegcms OPumrR1uvasSbAyuXoz9SOTSHHhu3Qk3M4JlVkDlMD9jImSjRKnXyr+dHH/u/Ya3IHIT nBsPZ6b6rlGj2augvwBRrOKnvjw9vcQvRNmlF1hEacFHgK7JAJQtd9eD45UFcV58ts+k P7Qh0UtnjEPZsCQyVGe5p8b5EIC3GkK3Zr2UujRkYAcI7jvAvqFX4Z4g2NcDmlszK0Cp iue2iZIEcNMOClSPg00+Mfz+DuvSZHuqI4Ewal+w87Zdmcl5VXfVxtKqwDOv477ghltg r7hg== X-Received: by 10.112.167.103 with SMTP id zn7mr213753lbb.63.1407959970435; Wed, 13 Aug 2014 12:59:30 -0700 (PDT) Received: from tamtam.fritz.box ([2001:4dd0:ff00:9394:224:d7ff:fec6:a0ec]) by mx.google.com with ESMTPSA id xu8sm1747726lab.41.2014.08.13.12.59.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Aug 2014 12:59:29 -0700 (PDT) From: Daniel Mack To: eric.y.miao@gmail.com, haojian.zhuang@gmail.com Subject: [PATCH 2/2] ARM: pxa3xx: provide specific platform_devices for all ssp ports Date: Wed, 13 Aug 2014 21:59:19 +0200 Message-Id: <1407959959-4977-2-git-send-email-zonque@gmail.com> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1407959959-4977-1-git-send-email-zonque@gmail.com> References: <1407959959-4977-1-git-send-email-zonque@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140813_125953_088122_30A95034 X-CRM114-Status: GOOD ( 15.43 ) X-Spam-Score: -0.8 (/) Cc: linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org, Daniel Mack X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Currently, devices for SSP ports 1, 2 and 3 are registered as compatible devices to pxa27x-ssp. While the actual IP core is comparable, there are some subtle differences which users of the SSP ports address by looking at the 'type' field. By registering devices of type 'pxa27x-ssp', this 'type' field is incorrectly set to PXA27x_SSP which confuses the users. To fix this, provide specific ssp port plaform devices which use 'pxa3xx-ssp' as driver name, an instantiate them from pxa3xx.c. Signed-off-by: Daniel Mack --- arch/arm/mach-pxa/devices.c | 42 ++++++++++++++++++++++++++++++++++++++++-- arch/arm/mach-pxa/devices.h | 3 +++ arch/arm/mach-pxa/pxa3xx.c | 14 +++++++------- 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index 78b7181..d1d8ea0 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c @@ -1099,9 +1099,47 @@ static struct resource pxa3xx_resource_ssp4[] = { }, }; +/* + * PXA3xx SSP is basically equivalent to PXA27x. + * However, we need to register the device by the correct name in order to + * make the driver set the correct internal type, hence we provide specific + * platform_devices for each of them. + */ +struct platform_device pxa3xx_device_ssp1 = { + .name = "pxa3xx-ssp", + .id = 0, + .dev = { + .dma_mask = &pxa27x_ssp1_dma_mask, + .coherent_dma_mask = DMA_BIT_MASK(32), + }, + .resource = pxa27x_resource_ssp1, + .num_resources = ARRAY_SIZE(pxa27x_resource_ssp1), +}; + +struct platform_device pxa3xx_device_ssp2 = { + .name = "pxa3xx-ssp", + .id = 1, + .dev = { + .dma_mask = &pxa27x_ssp2_dma_mask, + .coherent_dma_mask = DMA_BIT_MASK(32), + }, + .resource = pxa27x_resource_ssp2, + .num_resources = ARRAY_SIZE(pxa27x_resource_ssp2), +}; + +struct platform_device pxa3xx_device_ssp3 = { + .name = "pxa3xx-ssp", + .id = 2, + .dev = { + .dma_mask = &pxa27x_ssp3_dma_mask, + .coherent_dma_mask = DMA_BIT_MASK(32), + }, + .resource = pxa27x_resource_ssp3, + .num_resources = ARRAY_SIZE(pxa27x_resource_ssp3), +}; + struct platform_device pxa3xx_device_ssp4 = { - /* PXA3xx SSP is basically equivalent to PXA27x */ - .name = "pxa27x-ssp", + .name = "pxa3xx-ssp", .id = 3, .dev = { .dma_mask = &pxa3xx_ssp4_dma_mask, diff --git a/arch/arm/mach-pxa/devices.h b/arch/arm/mach-pxa/devices.h index 19906c9..298caea 100644 --- a/arch/arm/mach-pxa/devices.h +++ b/arch/arm/mach-pxa/devices.h @@ -28,6 +28,9 @@ extern struct platform_device pxa25x_device_assp; extern struct platform_device pxa27x_device_ssp1; extern struct platform_device pxa27x_device_ssp2; extern struct platform_device pxa27x_device_ssp3; +extern struct platform_device pxa3xx_device_ssp1; +extern struct platform_device pxa3xx_device_ssp2; +extern struct platform_device pxa3xx_device_ssp3; extern struct platform_device pxa3xx_device_ssp4; extern struct platform_device pxa25x_device_pwm0; diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c index 7675a5d..0c20bcf 100644 --- a/arch/arm/mach-pxa/pxa3xx.c +++ b/arch/arm/mach-pxa/pxa3xx.c @@ -84,10 +84,10 @@ static struct clk_lookup pxa3xx_clkregs[] = { INIT_CLKREG(&clk_pxa3xx_usbh, "pxa27x-ohci", NULL), INIT_CLKREG(&clk_pxa3xx_u2d, "pxa3xx-u2d", NULL), INIT_CLKREG(&clk_pxa3xx_keypad, "pxa27x-keypad", NULL), - INIT_CLKREG(&clk_pxa3xx_ssp1, "pxa27x-ssp.0", NULL), - INIT_CLKREG(&clk_pxa3xx_ssp2, "pxa27x-ssp.1", NULL), - INIT_CLKREG(&clk_pxa3xx_ssp3, "pxa27x-ssp.2", NULL), - INIT_CLKREG(&clk_pxa3xx_ssp4, "pxa27x-ssp.3", NULL), + INIT_CLKREG(&clk_pxa3xx_ssp1, "pxa3xx-ssp.0", NULL), + INIT_CLKREG(&clk_pxa3xx_ssp2, "pxa3xx-ssp.1", NULL), + INIT_CLKREG(&clk_pxa3xx_ssp3, "pxa3xx-ssp.2", NULL), + INIT_CLKREG(&clk_pxa3xx_ssp4, "pxa3xx-ssp.3", NULL), INIT_CLKREG(&clk_pxa3xx_pwm0, "pxa27x-pwm.0", NULL), INIT_CLKREG(&clk_pxa3xx_pwm1, "pxa27x-pwm.1", NULL), INIT_CLKREG(&clk_pxa3xx_mmc1, "pxa2xx-mci.0", NULL), @@ -456,9 +456,9 @@ static struct platform_device *devices[] __initdata = { &pxa_device_asoc_platform, &sa1100_device_rtc, &pxa_device_rtc, - &pxa27x_device_ssp1, - &pxa27x_device_ssp2, - &pxa27x_device_ssp3, + &pxa3xx_device_ssp1, + &pxa3xx_device_ssp2, + &pxa3xx_device_ssp3, &pxa3xx_device_ssp4, &pxa27x_device_pwm0, &pxa27x_device_pwm1,