public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javier@osg.samsung.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-kernel@vger.kernel.org, Nick Dyer <nick.dyer@itdev.co.uk>,
	linux-input@vger.kernel.org
Subject: Re: [PATCH v2] Input: atmel_mxt_ts - Add maxtouch to I2C table for module autoload
Date: Wed, 2 Dec 2015 17:15:13 -0300	[thread overview]
Message-ID: <565F5151.20808@osg.samsung.com> (raw)
In-Reply-To: <564F7889.3050402@osg.samsung.com>

Hello Dmitry,

On 11/20/2015 04:46 PM, Javier Martinez Canillas wrote:
> On 11/20/2015 04:32 PM, Javier Martinez Canillas wrote:
> 
> [snip]
> 
>>
>> But is not complete because the .driver_data in i2c_device_id is an
>> kernel_ulong_t while the .data in of_device_id is a const void * so
>> some casting will be needed to add an OF table in some drivers that
> 
> Some casting in the tables *and* some logic to get the .data from the
> OF table entries, so something like the following will be needed:
> 
> static int foo_i2c_probe(struct i2c_client *i2c,
>                          const struct i2c_device_id *id)
> {
>         struct of_device_id *match;
>         kernel_ulong_t data;
> 
>         if (i2c->dev.of_node) {
>                match = of_match_node(of_match, i2c->dev.of_node);
> 	       if (!match)
>                         return -EINVAL;
> 
>                data = (kernel_ulong_t)match->data;
>         } else {
>                data = id->driver_data;
> 	}
> 	...
> }
> 
> while currently I2C drivers just rely on the model part of the compatible
> string to match with the entry in the I2C device ID table and the core
> always passing the correct .driver_data to the probe function.
> 
> So as you can see, converting all the drivers to not rely on the I2C table
> requires some refactoring before proper OF modalias reporting can be used.
>

Any comments about this? I'm planning to address all this at some point but
for now I think we would need $SUBJECT to have module autoloading working
on this driver when the device is registered via OF.
 
> Best regards,
> 

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

  reply	other threads:[~2015-12-02 20:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20 19:09 [PATCH v2] Input: atmel_mxt_ts - Add maxtouch to I2C table for module autoload Javier Martinez Canillas
2015-11-20 19:15 ` Dmitry Torokhov
2015-11-20 19:32   ` Javier Martinez Canillas
2015-11-20 19:46     ` Javier Martinez Canillas
2015-12-02 20:15       ` Javier Martinez Canillas [this message]
2015-12-10 23:07   ` Javier Martinez Canillas
2015-12-11 21:24     ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=565F5151.20808@osg.samsung.com \
    --to=javier@osg.samsung.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nick.dyer@itdev.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox