From patchwork Thu Jun 30 06:31:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 2381 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2D44323F3D for ; Thu, 30 Jun 2011 06:32:47 +0000 (UTC) Received: from mail-qy0-f180.google.com (mail-qy0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id C0D37A1847A for ; Thu, 30 Jun 2011 06:32:46 +0000 (UTC) Received: by qyk30 with SMTP id 30so1352451qyk.11 for ; Wed, 29 Jun 2011 23:32:46 -0700 (PDT) Received: by 10.229.63.144 with SMTP id b16mr1286059qci.80.1309415566197; Wed, 29 Jun 2011 23:32:46 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.48.135 with SMTP id r7cs63210qcf; Wed, 29 Jun 2011 23:32:45 -0700 (PDT) Received: by 10.213.99.76 with SMTP id t12mr634003ebn.46.1309415563651; Wed, 29 Jun 2011 23:32:43 -0700 (PDT) Received: from eu1sys200aog120.obsmtp.com (eu1sys200aog120.obsmtp.com [207.126.144.149]) by mx.google.com with SMTP id x53si3746402eex.52.2011.06.29.23.32.38 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 29 Jun 2011 23:32:43 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.149 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.149; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.149 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob120.postini.com ([207.126.147.11]) with SMTP ID DSNKTgwYg0UPV9fjyeEGqJsp6AVZY3Wt1Jqy@postini.com; Thu, 30 Jun 2011 06:32:42 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 16DE4D7; Thu, 30 Jun 2011 06:32:11 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 56200DA0; Thu, 30 Jun 2011 06:32:10 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 901FDA807E; Thu, 30 Jun 2011 08:32:06 +0200 (CEST) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 30 Jun 2011 08:32:09 +0200 From: Linus Walleij To: , Cc: Axel Lin , Lee Jones , Linus Walleij Subject: [PATCH] staging/ste_rmi4: remove cross-dependent platform data Date: Thu, 30 Jun 2011 08:31:59 +0200 Message-ID: <1309415519-27887-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.3.2 MIME-Version: 1.0 From: Linus Walleij The ux500 machine was actually defining platform data for the staging driver ste_rmi4, which is not OK. Let us instead define some __weak platform data in the machine so that the staging driver can override it at compile-time and we can thus have the driver self-contained in staging. Reported-by: Axel Lin Signed-off-by: Linus Walleij --- arch/arm/mach-ux500/board-mop500-u8500uib.c | 24 +------------- drivers/staging/ste_rmi4/Makefile | 1 + .../staging/ste_rmi4/board-mop500-u8500uib-rmi4.c | 32 ++++++++++++++++++++ 3 files changed, 35 insertions(+), 22 deletions(-) create mode 100644 drivers/staging/ste_rmi4/board-mop500-u8500uib-rmi4.c diff --git a/arch/arm/mach-ux500/board-mop500-u8500uib.c b/arch/arm/mach-ux500/board-mop500-u8500uib.c index d8a8734..8ce46c0 100644 --- a/arch/arm/mach-ux500/board-mop500-u8500uib.c +++ b/arch/arm/mach-ux500/board-mop500-u8500uib.c @@ -12,34 +12,14 @@ #include #include #include -#include <../drivers/staging/ste_rmi4/synaptics_i2c_rmi4.h> #include #include #include "board-mop500.h" -/* - * Synaptics RMI4 touchscreen interface on the U8500 UIB - */ - -/* - * Descriptor structure. - * Describes the number of i2c devices on the bus that speak RMI. - */ -static struct synaptics_rmi4_platform_data rmi4_i2c_dev_platformdata = { - .irq_number = NOMADIK_GPIO_TO_IRQ(84), - .irq_type = (IRQF_TRIGGER_FALLING | IRQF_SHARED), - .x_flip = false, - .y_flip = true, - .regulator_en = false, -}; - -static struct i2c_board_info __initdata mop500_i2c3_devices_u8500[] = { - { - I2C_BOARD_INFO("synaptics_rmi4_i2c", 0x4B), - .platform_data = &rmi4_i2c_dev_platformdata, - }, +/* Dummy data that can be overridden by staging driver */ +struct i2c_board_info __initdata __weak mop500_i2c3_devices_u8500[] = { }; /* diff --git a/drivers/staging/ste_rmi4/Makefile b/drivers/staging/ste_rmi4/Makefile index 6cce2ed..176f469 100644 --- a/drivers/staging/ste_rmi4/Makefile +++ b/drivers/staging/ste_rmi4/Makefile @@ -2,3 +2,4 @@ # Makefile for the RMI4 touchscreen driver. # obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4) += synaptics_i2c_rmi4.o +obj-$(CONFIG_MACH_U8500) += board-mop500-u8500uib-rmi4.o diff --git a/drivers/staging/ste_rmi4/board-mop500-u8500uib-rmi4.c b/drivers/staging/ste_rmi4/board-mop500-u8500uib-rmi4.c new file mode 100644 index 0000000..a272e48 --- /dev/null +++ b/drivers/staging/ste_rmi4/board-mop500-u8500uib-rmi4.c @@ -0,0 +1,32 @@ +/* + * Some platform data for the RMI4 touchscreen that will override the __weak + * platform data in the Ux500 machine if this driver is activated. + */ +#include +#include +#include +#include +#include +#include "synaptics_i2c_rmi4.h" + +/* + * Synaptics RMI4 touchscreen interface on the U8500 UIB + */ + +/* + * Descriptor structure. + * Describes the number of i2c devices on the bus that speak RMI. + */ +static struct synaptics_rmi4_platform_data rmi4_i2c_dev_platformdata = { + .irq_number = NOMADIK_GPIO_TO_IRQ(84), + .irq_type = (IRQF_TRIGGER_FALLING | IRQF_SHARED), + .x_flip = false, + .y_flip = true, +}; + +struct i2c_board_info __initdata mop500_i2c3_devices_u8500[] = { + { + I2C_BOARD_INFO("synaptics_rmi4_i2c", 0x4B), + .platform_data = &rmi4_i2c_dev_platformdata, + }, +};