freebsd-dev/sys
Ian Lepore 844aff82a6 Allow i2c bus speed to be configured via hints, FDT data, and sysctl.
The current support for controlling i2c bus speed is an inconsistant mess.
There are 4 symbolic speed values defined, UNKNOWN, SLOW, FAST, FASTEST.
It seems to be universally assumed that SLOW means the standard 100KHz
rate from the original spec.  Nothing ever calls iicbus_reset() with a
speed of FAST, although some drivers would treat it as the 400KHz standard
speed.  Mostly iicbus_reset() is called with the speed set to UNKNOWN or
FASTEST, and there's really no telling what any individual driver will do
with those.

The speed of an i2c bus is limited by the speed of the slowest device on
the bus.  This means that generally the bus speed needs to be configured
based on the board/system and the components within it.  Historically for
i2c we've configured with device hints.  Newer systems use FDT data and it
documents a clock-frequency property for i2c busses.  Hobbyists and
developers are likely to want on the fly changes.  These changes provide
all 3 methods, but do not require any existing drivers to change to use
the new facilities.

This adds an iicbus method, iicbus_get_frequency(dev, speed) that gets the
frequency for the requested symbolic speed.  If the symbolic speed is SLOW
or if there is no speed configured for the bus, the returned value is
100KHz, always.  Otherwise, if bus speed is configured by hints, fdt,
tunable, or sysctl, that speed is returned.  It also adds a helper
function, iicbus_init_frequency() that any bus driver subclassed from
iicbus can initialize the frequency from some other source of info.

Initial driver implementations are provided for Freescale and TI.

Differential Revision:        https://reviews.freebsd.org/D1174
PR:		195009
2014-11-18 01:54:31 +00:00
..
amd64 Enable the use of VM_PHYSSEG_SPARSE on amd64 and i386, making it the default 2014-11-15 23:40:44 +00:00
arm Allow i2c bus speed to be configured via hints, FDT data, and sysctl. 2014-11-18 01:54:31 +00:00
boot MFi386: r274398 2014-11-15 03:34:34 +00:00
bsm
cam Fix check for vendor-specific peripheral qualifier. 2014-11-13 18:15:05 +00:00
cddl l2arc: restore correct rounding up of asize of compressed data 2014-11-17 14:45:42 +00:00
compat Remove the no-at variants of the kern_xx() syscall helpers. E.g., we 2014-11-13 18:01:51 +00:00
conf Automate options INET/INET6 turning into MK_$opt_SUPPORT 2014-11-14 21:10:45 +00:00
contrib krping: In verbose mode print only first 128 bytes of krping data. 2014-10-27 22:41:55 +00:00
crypto Fix gcc build: preserve const qualifier when casting input values. 2014-11-11 13:37:28 +00:00
ddb ddb: ANSI-fy function declarations. 2014-10-12 18:01:52 +00:00
dev Allow i2c bus speed to be configured via hints, FDT data, and sysctl. 2014-11-18 01:54:31 +00:00
fs ifdef ext2_print_inode which is not really used. 2014-11-12 16:23:56 +00:00
gdb Add support for gdb's memory searching capabilities to our in-kernel gdb 2014-09-05 16:40:47 +00:00
geom Add missing privilege check when setting the dump device. Before that change it 2014-11-11 04:48:09 +00:00
gnu reiserfs: Use signed i_nlink 2014-09-25 19:10:32 +00:00
i386 Enable the use of VM_PHYSSEG_SPARSE on amd64 and i386, making it the default 2014-11-15 23:40:44 +00:00
isa
kern prevent doing filter ops locking for staticly compiled filter ops... 2014-11-16 01:18:41 +00:00
kgssapi Avoid dynamic syscall overhead for statically compiled modules. 2014-10-26 19:42:44 +00:00
libkern Sync with userland variant. 2014-11-17 21:01:35 +00:00
mips Renove faith(4) and faithd(8) from base. It looks like industry 2014-11-09 21:33:01 +00:00
modules Use automated MK_INET*_SUPPORT code here as well. 2014-11-18 01:39:23 +00:00
net Finish r274175: do control plane MTU tracking. 2014-11-17 01:05:29 +00:00
net80211 Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
netgraph In preparation of merging projects/sendfile, transform bare access to 2014-11-12 09:57:15 +00:00
netinet Re-introduce padding fields removed with r264321 to keep 2014-11-17 14:56:02 +00:00
netinet6 Finish r274175: do control plane MTU tracking. 2014-11-17 01:05:29 +00:00
netipsec Count statistics for the specific address family. 2014-11-13 12:58:33 +00:00
netnatm
netpfil Finish r274315: remove union 'u' from struct pf_send_entry. 2014-11-09 17:01:54 +00:00
netsmb
nfs Avoid dynamic syscall overhead for statically compiled modules. 2014-10-26 19:42:44 +00:00
nfsclient Follow up to r225617. In order to maximize the re-usability of kernel code 2014-10-16 18:04:43 +00:00
nfsserver Change NFS readdir() to only ignore cookies preceding the given offset for 2014-07-01 20:00:35 +00:00
nlm Avoid dynamic syscall overhead for statically compiled modules. 2014-10-26 19:42:44 +00:00
ofed In preparation of merging projects/sendfile, transform bare access to 2014-11-12 09:57:15 +00:00
opencrypto Fix build for kernels without COMPAT_FREEBSD32. 2014-09-22 17:32:27 +00:00
pc98 Renove faith(4) and faithd(8) from base. It looks like industry 2014-11-09 21:33:01 +00:00
powerpc Renove faith(4) and faithd(8) from base. It looks like industry 2014-11-09 21:33:01 +00:00
rpc In preparation of merging projects/sendfile, transform bare access to 2014-11-12 09:57:15 +00:00
security Replace dev_clone with cdevpriv(9) KPI in audit_pipe code. 2014-08-20 16:04:30 +00:00
sparc64 Renove faith(4) and faithd(8) from base. It looks like industry 2014-11-09 21:33:01 +00:00
sys prevent doing filter ops locking for staticly compiled filter ops... 2014-11-16 01:18:41 +00:00
teken
tools Allow the make_dtb script to work outside of a "make buildkernel" context 2014-08-30 22:39:15 +00:00
ufs When non-forced unmount or remount rw->ro is performed, writes on UFS 2014-11-02 13:14:55 +00:00
vm Enable the use of VM_PHYSSEG_SPARSE on amd64 and i386, making it the default 2014-11-15 23:40:44 +00:00
x86 MFamd64: Add support for extended FPU states on i386. This includes 2014-11-02 22:58:30 +00:00
xdr
xen xen: implement the privcmd user-space device 2014-10-22 17:07:20 +00:00
Makefile Remove "pci" from CSCOPEDIRS. 2014-09-23 06:32:19 +00:00