linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How should I use kernel-defined i2c structs in this driver
@ 2016-05-26 13:59 Andrey Utkin
  2016-05-27  0:14 ` Antti Palosaari
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Utkin @ 2016-05-26 13:59 UTC (permalink / raw)
  To: kernel-mentors, devel, linux-pci, linux-kernel, linux-media; +Cc: andrey.utkin

Could anybody please give a hint - which kernel-defined i2c objects, and how
many of them, I need to define and use to substitute these driver-defined
functions i2c_read(), i2c_write() ?
https://github.com/bluecherrydvr/linux/blob/release/tw5864/1.16/drivers/media/pci/tw5864/tw5864-config.c
In a word, there's 4 chips with different addresses, to which this code
communicates via main chip's dedicated registers.
Do i need a single i2c_adapter or several?
Do i need i2c_client entities?
where should I put what is named "devid" here?

Thanks in advance.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How should I use kernel-defined i2c structs in this driver
  2016-05-26 13:59 How should I use kernel-defined i2c structs in this driver Andrey Utkin
@ 2016-05-27  0:14 ` Antti Palosaari
  0 siblings, 0 replies; 2+ messages in thread
From: Antti Palosaari @ 2016-05-27  0:14 UTC (permalink / raw)
  To: Andrey Utkin, kernel-mentors, devel, linux-pci, linux-kernel,
	linux-media
  Cc: andrey.utkin

On 05/26/2016 04:59 PM, Andrey Utkin wrote:
> Could anybody please give a hint - which kernel-defined i2c objects, and how
> many of them, I need to define and use to substitute these driver-defined
> functions i2c_read(), i2c_write() ?
> https://github.com/bluecherrydvr/linux/blob/release/tw5864/1.16/drivers/media/pci/tw5864/tw5864-config.c
> In a word, there's 4 chips with different addresses, to which this code
> communicates via main chip's dedicated registers.
> Do i need a single i2c_adapter or several?
> Do i need i2c_client entities?
> where should I put what is named "devid" here?
>
> Thanks in advance.

It depends how those are connected at hardware level. Quickly looking I 
think "devid" is here to select proper I2C adapter. So I think there is 
4 I2C adapters and each of those adapter has 1 slave device. Is that 
correct? If yes, then register 4 I2C adapters and register single client 
for each of those adapters.

regards
Antti



-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-27  0:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-26 13:59 How should I use kernel-defined i2c structs in this driver Andrey Utkin
2016-05-27  0:14 ` Antti Palosaari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).