Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753174AbaF2KzZ (ORCPT ); Sun, 29 Jun 2014 06:55:25 -0400 Received: from mail.kernel.org ([198.145.19.201]:52601 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753107AbaF2KzV (ORCPT ); Sun, 29 Jun 2014 06:55:21 -0400 Message-ID: <53AFF114.4050905@kernel.org> Date: Sun, 29 Jun 2014 11:57:24 +0100 From: Jonathan Cameron User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Belisko Marek CC: Rob Herring , Pawel Moll , Mark Rutland , "ijc+devicetree@hellion.org.uk" , Kumar Gala , Rob Landley , Peter Meerwald , "devicetree@vger.kernel.org" , "linux-doc@vger.kernel.org" , LKML , linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, "Dr. H. Nikolaus Schaller" Subject: Re: [PATCH 1/2] staging: iio: hmc5843: Add all available models to device tree id table. References: <1392387929-31491-1-git-send-email-marek@goldelico.com> <530338B2.603@kernel.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/06/14 21:48, Belisko Marek wrote: > PIng? Jonathan do you have any objections to this approach? Can you > please pick it? Thx. Sorry, this one dropped through the cracks. Applied to the togreg branch of iio.git along with the documentation patch that goes with it. Jonathan > > On Tue, Feb 18, 2014 at 9:35 PM, Belisko Marek wrote: >> Hi Jonathan, >> >> On Tue, Feb 18, 2014 at 11:40 AM, Jonathan Cameron wrote: >>> On 14/02/14 14:25, Marek Belisko wrote: >>>> >>>> Signed-off-by: Marek Belisko >>> >>> I wonder how this got missed. However, for those data elements to be >>> useful, you will >>> need to read them somewhere in the driver I think.... (if there is any magic >>> that puts this in the relevant i2c locations then point it out to me!) >> There is a table called hmc5843_chip_info_tbl which contains entries >> for all models >> which this driver can handle. And magic is that correct model variant >> is set probe function: >> line: idata->variant = &hmc5843_chip_info_tbl[id->driver_data]; >> (id->driver_data contains model value). >>> >>>> --- >>>> drivers/staging/iio/magnetometer/hmc5843.c | 4 +++- >>>> 1 file changed, 3 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/staging/iio/magnetometer/hmc5843.c >>>> b/drivers/staging/iio/magnetometer/hmc5843.c >>>> index d4f4dd9..f595fdc 100644 >>>> --- a/drivers/staging/iio/magnetometer/hmc5843.c >>>> +++ b/drivers/staging/iio/magnetometer/hmc5843.c >>>> @@ -630,7 +630,9 @@ static const struct i2c_device_id hmc5843_id[] = { >>>> MODULE_DEVICE_TABLE(i2c, hmc5843_id); >>>> >>>> static const struct of_device_id hmc5843_of_match[] = { >>>> - { .compatible = "honeywell,hmc5843" }, >>>> + { .compatible = "honeywell,hmc5843", .data = (void *)HMC5843_ID }, >>>> + { .compatible = "honeywell,hmc5883", .data = (void *)HMC5883_ID }, >>>> + { .compatible = "honeywell,hmc5883l", .data = (void *)HMC5883L_ID >>>> }, >>>> {} >>>> }; >>>> MODULE_DEVICE_TABLE(of, hmc5843_of_match); >>>> >>> >> >> BR, >> >> marek >> >> -- >> as simple and primitive as possible >> ------------------------------------------------- >> Marek Belisko - OPEN-NANDRA >> Freelance Developer >> >> Ruska Nova Ves 219 | Presov, 08005 Slovak Republic >> Tel: +421 915 052 184 >> skype: marekwhite >> twitter: #opennandra >> web: http://open-nandra.com > > BR, > > marek > -- 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/