Re: [PATCH 2/2] i2c: i801: add support of Host Notify

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

 



On Tue, 7 Jul 2015 16:16:38 -0400, Benjamin Tissoires wrote:
> On Jul 07 2015 or thereabouts, Jean Delvare wrote:
> > So you use the same driver callback for SMBus Alert and SMBus Host
> > Notify. This makes some sense, but if a given driver supports both, how
> > does it know which event happened? The data is completely different and
> > most probably the action required from the driver as well.
> 
> Yeah, this gets messy. I re-used the .alert() callback because of the
> documentation:  "Alert callback, for example for the SMBus alert protocol".
> It would seem that the alert is generic and could be re-used. But OTOH,
> it is not prepared to receive anything else than a SMBus Alert.
> 
> Given that I had a toggle_host_notify() call, I figured that this was
> not a problem unless you write a driver which implements both (I can not
> find a sane use case for this though).
> 
> But now that this call has disappeared, we would need a way to
> differentiate the too of them.
> 
> I can see two solutions out of my head right now:
> - add a "protocol" parameter (with an enum) to .alert()
> - add a new callback .host_notify() in struct i2c_driver.

I came to the same conclusion.

> I think I like the second option more given that it will allow to not
> touch the current code in i2c_smbus.

No strong preference so do it the way you prefer.

Thanks,
-- 
Jean Delvare
SUSE L3 Support
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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