Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755311AbZAJSqs (ORCPT ); Sat, 10 Jan 2009 13:46:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752140AbZAJSqi (ORCPT ); Sat, 10 Jan 2009 13:46:38 -0500 Received: from ppsw-7.csi.cam.ac.uk ([131.111.8.137]:47263 "EHLO ppsw-7.csi.cam.ac.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751059AbZAJSqh (ORCPT ); Sat, 10 Jan 2009 13:46:37 -0500 X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Message-ID: <4968ED0D.9040103@gmail.com> Date: Sat, 10 Jan 2009 18:46:37 +0000 From: Jonathan Cameron User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: LKML , linux-i2c@vger.kernel.org CC: Mark Brown Subject: Re: Regulator consumer and i2c device interaction. References: <4968C652.2050300@gmail.com> In-Reply-To: <4968C652.2050300@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1821 Lines: 57 Jonathan Cameron wrote: > Dear All, > > Currently regulator consumers are registered and identified via a pointer to the relevant > device: > > e.g. via a regulator consumer supply structure: > static struct regulator_consumer_supply imote2_sensor_3_con[] = { > { > .dev = &sht15.dev, > .supply = "vcc", > }, > }; > > static struct regulator_init_data imote2_ldo_init_data[] = {{ > { > .constraints = { > .name = "vcc_sensor_3", > .min_uV = 2800000, > .max_uV = 3000000, > .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, > }, > .num_consumer_supplies = ARRAY_SIZE(imote2_sensor_3_con), > .consumer_supplies = imote2_sensor_3_con, > }, > }; > > and relevant association with a regulator driver. > > Now in the case of i2c devices, the struct device pointer is created > somewhat later and isn't readily available. > > I think the struct device pointer is only used as device instance specific > token in the regulator framework. If so is there any reason it can't be > relaxed to a void * thus allowing something else to be used in i2c drivers? > > If so what could actually be used? Unfortunately all the data elements > of i2c_board_info are coppied out (rather than a pointer to the original > structure being used) so that's not currently available. I guess it could > be made so at the cost of a single pointer in each i2c_client structure. > Oops, that won't work as typically these are specified __initdata . Any suggestions for alternatives? > So the question is how would people prefer to do this? > > Thanks, > > -- > Jonathan Cameron > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/