Re: [PATCH v3 0/7] Add Mule I2C multiplexer support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Farouk,

first of all, thanks for the patches and tackling this problem. I have
to say that I have many concerns on high-level, though. I hope to be
able to give helpful recommendations.

> Mule is an mcu that emulates a set of I2C devices which are reachable
> through an I2C-mux.

I am not 100% convinced this is really a mux. Another possible DT
representation could be (pseudo-code):

	i2c-bus {
		mpu@42 {
			comptible = "mule";
			reg = <0x42>;

			subdev@0 {
				compatible = "subdev"
				reg = <0x00>;
			}

			subdev@1 {

			...

		}

	}

Dunno if MFD can handle that. Maybe someone else knows?

If all fails, I think you could write an I2C mux-driver which uses the
above DT snippet. It should then do:

- write the mule config register according to 'reg' of the subdev
- replace 'addr' in all 'i2c_msgs' to the addr of the parent mule device
- i2ctransfer
- restore 'addr' in all 'i2c_msgs' to the original addr

A little simiar of what i2c-atr.c does, check
Documentation/i2c/i2c-address-translators.rst

> The emulated devices share a single I2C address with the mux itself
> where the requested register is what determines which logic is executed
> (muxing logic or device logic):

This design is... unfortunate, if you ask me. But well, things happen.

> The current I2C-mux implementation does not allow the mux to use the
> I2C address of a child device. As a workaround, A new I2C-adapter quirk is
> introduced to skip the check for conflict between a child device and the
> mux core I2C address when adding the child device.

Not acceptable, sorry. The adapter itself is fine, so this is clearly
not an adapter quirk. The client is what is quirky. I don't want to
maintain patch 1 because of this one "creative" design of a client. I
think we can handle it outside of the I2C core.

So far understandable?

Happy hacking,

   Wolfram

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux