From patchwork Fri Apr 2 21:37:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Fischer X-Patchwork-Id: 90492 Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o32Ld7Ld027705 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 2 Apr 2010 21:39:47 GMT Received: from dlep36.itg.ti.com ([157.170.170.91]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o32LbgOw028602 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 2 Apr 2010 16:37:42 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id o32LbfMh029325; Fri, 2 Apr 2010 16:37:41 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id F3DB380635; Fri, 2 Apr 2010 15:37:32 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 5C9A580627 for ; Fri, 2 Apr 2010 15:36:48 -0600 (CST) Received: from white.ext.ti.com (localhost [127.0.0.1]) by dflp52.itg.ti.com (8.13.7/8.13.7) with ESMTP id o32Lammq016196 for ; Fri, 2 Apr 2010 16:36:48 -0500 (CDT) Received: from psmtp.com (na3sys009amx204.postini.com [74.125.149.44]) by white.ext.ti.com (8.13.7/8.13.7) with SMTP id o32LakfC013078 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 2 Apr 2010 16:36:47 -0500 Received: from source ([71.216.156.246]) (using TLSv1) by na3sys009amx204.postini.com ([74.125.148.10]) with SMTP; Fri, 02 Apr 2010 16:36:47 CDT Received: from sax-lx.fischerfamily.org ([10.0.0.3] helo=localhost.localdomain) by gw with esmtp (Exim 4.69) (envelope-from ) id 1NxoTs-0008Le-Db; Fri, 02 Apr 2010 15:32:44 -0600 From: Todd Fischer To: linux-kernel@vger.kernel.org, davinci-linux-open-source@linux.davincidsp.com, sameo@linux.intel.com, lrg@slimlogic.co.uk, broonie@opensource.wolfsonmicro.com, todd.fischer@ridgerun.com Subject: [PATCH 2/4]-V2 Make room for other tps6507x drivers to have board specific initialization data. Date: Fri, 2 Apr 2010 15:37:31 -0600 Message-Id: <1270244253-4234-3-git-send-email-todd.fischer@ridgerun.com> X-Mailer: git-send-email 1.6.0.4 In-Reply-To: <1270244253-4234-2-git-send-email-todd.fischer@ridgerun.com> References: <1270244253-4234-1-git-send-email-todd.fischer@ridgerun.com> <1270244253-4234-2-git-send-email-todd.fischer@ridgerun.com> Organization: RidgeRun X-SA-Exim-Connect-IP: 10.0.0.3 X-SA-Exim-Mail-From: todd.fischer@ridgerun.com X-SA-Exim-Scanned: No (on gw); SAEximRunCond expanded to false X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:42.16310/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 2 (0.5000:0.5000) s cv gt3 gt2 gt1 r p m c X-pstn-addresses: from [db-null] X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 02 Apr 2010 21:39:48 +0000 (UTC) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 411284d..d059924 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -533,10 +534,14 @@ struct regulator_init_data tps65070_regulator_data[] = { }, }; +static struct tps6507x_board tps_board = { + .tps6507x_pmic_init_data = &tps65070_regulator_data[0], +}; + static struct i2c_board_info __initdata da850evm_tps65070_info[] = { { I2C_BOARD_INFO("tps6507x", 0x48), - .platform_data = &tps65070_regulator_data[0], + .platform_data = &tps_board, }, }; diff --git a/drivers/regulator/tps6507x-regulator.c b/drivers/regulator/tps6507x-regulator.c index 91172e3..becf652 100644 --- a/drivers/regulator/tps6507x-regulator.c +++ b/drivers/regulator/tps6507x-regulator.c @@ -488,6 +488,7 @@ static int __devinit tps_6507x_probe(struct i2c_client *client, struct regulator_init_data *init_data; struct regulator_dev *rdev; struct tps_pmic *tps; + struct tps6507x_board *tps_board; int i; int error; @@ -496,12 +497,21 @@ static int __devinit tps_6507x_probe(struct i2c_client *client, return -EIO; /** + * tps_board points to pmic related constants + * coming from the board-evm file. + */ + + tps_board = dev_get_platdata(&client->dev); + if (!tps_board) + return -EINVAL; + + /** * init_data points to array of regulator_init structures * coming from the board-evm file. */ - init_data = client->dev.platform_data; + init_data = tps_board->tps6507x_pmic_init_data; if (!init_data) - return -EIO; + return -EINVAL; tps = kzalloc(sizeof(*tps), GFP_KERNEL); if (!tps) diff --git a/include/linux/mfd/tps6507x.h b/include/linux/mfd/tps6507x.h index 155bee1..fd73af5 100644 --- a/include/linux/mfd/tps6507x.h +++ b/include/linux/mfd/tps6507x.h @@ -131,4 +131,15 @@ /* VDCDC MASK */ #define TPS6507X_DEFDCDCX_DCDC_MASK 0X3F +/** + * struct tps6507x_board - packages regulator and touchscreen init data + * @tps6507x_regulator_data: regulator initialization values + * + * Board data may be used to initialize regulator and touchscreen. + */ + +struct tps6507x_board { + struct regulator_init_data *tps6507x_pmic_init_data; +}; + #endif /* __LINUX_MFD_TPS6507X_H */