Re: RFC: Alchemy Au1550 SMBus driver on PSC

Shigeyuki Fukushima <[email protected]>
Newsgroups gmane.os.netbsd.ports.evbmips
Organization NetBSD Developper
Message-ID <[email protected]>
Garrett D'Amore wrote:
> This looks pretty good.

Thanks.

> Only one question: in aupsc_enable(), why do you bother to complain if
> it is already enabled?  I think this should be one of two things:
> 
> 1) if it is a programmer error, then make it a KASSERT()
> 
> 2) if there is some reason why its not programmer error, then you should
> probably just do the disable() yourself, and maybe put a message in an
> #ifdef DIAGNOSTIC or somesuch.

I assume 2).
This is my assumption:
  Maybe board-providers can connect i2c devices and spi devices
  to same psc device.
  But, we cannot use two or more protocols on a psc device
  at the same time.
  When we may need switching protocol on a psc device,
  we may need to check already-enabled status on this device.


If this assumption is wrong
(for example, when we can only one (fixed) protocol on a psc device),
we need to reconsider a concept of implementing this driver,
and to detect kernel configuration errors.

Kernel configuration error example:
ausmbus*	at aupsc0
auspi*		at aupsc0


I'm at a loss.
What do you think about it?
-- 
Kind Regards,
--- shige
Shigeyuki Fukushima <shige@{FreeBSD,jp.FreeBSD,NetBSD}.org>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.