# Re: \[PATCHv4 04/10\] fbdev: ssd1307fb: Unify init code and obtain hw specific bits from DT

- From: Maxime Ripard \<hidden\>
- Date: 2015-03-24 16:16:21 
- List: linux-fbdev
- Page: https://ratatoskr.run/linux-fbdev/2015/03/4457902
- Thread: https://ratatoskr.run/linux-fbdev/2015/02/4427371/t/2.md

```text
On Fri, Mar 20, 2015 at 10:12:54PM +0100, Thomas Niederprüm wrote:
> > >  static const struct of_device_id ssd1307fb_of_match[] = {
> > >  	{
> > >  		.compatible = "solomon,ssd1306fb-i2c",
> > > -		.data = (void *)&ssd1307fb_ssd1306_ops,
> > > +		.data = (void *)&ssd1307fb_ssd1306_deviceinfo,
> > >  	},
> > >  	{
> > >  		.compatible = "solomon,ssd1307fb-i2c",
> > > -		.data = (void *)&ssd1307fb_ssd1307_ops,
> > > +		.data = (void *)&ssd1307fb_ssd1307_deviceinfo,
> > 
> > Do we need this ID? Wouldn't it make more sense to pass the pointer to
> > the struct we need to use?
> 
> Are you talking about the device_id inside the struct
> ssd1307_deviceinfo?

Yes.

> I need the device_id to serve special needs of the individual
> controllers during initialization. For example the ssd1307 needs to
> set up the pwm in the init code.

Then you can add a bool in the structure to say whether it needs a PWM
or not.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
```

## Attachments

- [signature.asc](https://ratatoskr.run/linux-fbdev/2015/03/4457902/attachment/0) (application/pgp-signature, 819 bytes)
