| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add capability to SPIBUS to have child device with IRQ.
For example many ADC chip have a dedicated pin to signal "data ready"
and the host can just wait for a interrupt to go out and read the result.
It is the same code as in R282674 and R282702 for IICBUS by Michal Meloun
Submitted by: Oskar Holmund <oskar.holmlund@ohdata.se>
Differential Revision: https://reviews.freebsd.org/D27396
Notes:
svn path=/head/; revision=368725
|
| |
|
|
| |
Notes:
svn path=/head/; revision=365151
|
| |
|
|
|
|
|
|
|
|
| |
directly. This improves API compliance, asserts, etc.
Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D23283
Notes:
svn path=/head/; revision=357017
|
| |
|
|
|
|
|
|
|
|
|
|
| |
o Remove All Rights Reserved from my notices
o imp@FreeBSD.org everywhere
o regularize punctiation, eliminate date ranges
o Make sure that it's clear that I don't claim All Rights reserved by listing
All Rights Reserved on same line as other copyright holders (but not
me). Other such holders are also listed last where it's clear.
Notes:
svn path=/head/; revision=355394
|
| |
|
|
|
|
|
|
| |
Also rename SPIBUS_PNP_INFO -> SPIBUS_FDT_PNP_INFO because there could be
other kinds of pnpinfo for other (non-fdt) bus attachments.
Notes:
svn path=/head/; revision=348172
|
| |
|
|
|
|
|
|
| |
Some devices (such as spigen(4)) document that this works, but it appears that the
code to implement it never got added.
Notes:
svn path=/head/; revision=344556
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove unused and easy to misuse PNP macro parameter
Inspired by r338025, just remove the element size parameter to the
MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to
have correct pointer (or array) type. Since all invocations of the macro
already had this property and the emitted PNP data continues to include the
element size, there is no functional change.
Mostly done with the coccinelle 'spatch' tool:
$ cat modpnpsize0.cocci
@normaltables@
identifier b,c;
expression a,d,e;
declarer MODULE_PNP_INFO;
@@
MODULE_PNP_INFO(a,b,c,d,
-sizeof(d[0]),
e);
@singletons@
identifier b,c,d;
expression a;
declarer MODULE_PNP_INFO;
@@
MODULE_PNP_INFO(a,b,c,&d,
-sizeof(d),
1);
$ rg -l MODULE_PNP_INFO -- sys | \
xargs spatch --in-place --sp-file modpnpsize0.cocci
(Note that coccinelle invokes diff(1) via a PATH search and expects diff to
tolerate the -B flag, which BSD diff does not. So I had to link gdiff into
PATH as diff to use spatch.)
Tinderbox'd (-DMAKE_JUST_KERNELS).
Approved by: re (glen)
Notes:
svn path=/head/; revision=338948
|
| |
|
|
|
|
|
|
|
|
| |
I was not aware Warner was making or planning to make forward progress in
this area and have since been informed of that.
It's easy to apply/reapply when churn dies down.
Notes:
svn path=/head/; revision=338037
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Inspired by r338025, just remove the element size parameter to the
MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to
have correct pointer (or array) type. Since all invocations of the macro
already had this property and the emitted PNP data continues to include the
element size, there is no functional change.
Mostly done with the coccinelle 'spatch' tool:
$ cat modpnpsize0.cocci
@normaltables@
identifier b,c;
expression a,d,e;
declarer MODULE_PNP_INFO;
@@
MODULE_PNP_INFO(a,b,c,d,
-sizeof(d[0]),
e);
@singletons@
identifier b,c,d;
expression a;
declarer MODULE_PNP_INFO;
@@
MODULE_PNP_INFO(a,b,c,&d,
-sizeof(d),
1);
$ rg -l MODULE_PNP_INFO -- sys | \
xargs spatch --in-place --sp-file modpnpsize0.cocci
(Note that coccinelle invokes diff(1) via a PATH search and expects diff to
tolerate the -B flag, which BSD diff does not. So I had to link gdiff into
PATH as diff to use spatch.)
Tinderbox'd (-DMAKE_JUST_KERNELS).
Notes:
svn path=/head/; revision=338035
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Resources used by spigen_mmap_single() are now tracked using
devfs_set_cdevpriv() rather than in the softc.
- Since resources are now tracked per-open-fd, there is no need to try to
impose any exclusive-open logic, so flags related to that are removed.
- Flags used to track open status to prevent detach() when the device is
open are replaced with calls to device_busy()/device_unbusy(). That
extends the protection up the hierarchy so that the spibus and hardware
controller drivers also can't be detached while the device is open/in use.
- Arbitrary limits on the maximum size of a transfer are removed, along with
the sysctl variables that allowed the limits to be changed. There is just
no reason to limit the size of a spi transfer to the machine's page size.
Or to any other arbitrary value, really.
- Most of the locking is removed. It was mostly protecting access to flags
and fields in the softc that no longer exist. The locking that remains is
just to prevent concurrent calls to device_[un]busy().
- The code was calling malloc() with M_WAITOK while holding a mutex in
several places. Since most of the locking is gone, that's fixed.
Notes:
svn path=/head/; revision=336202
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
than assigning spigen device names in order of creation, this uses a device
name that corresponds to the owning spibus and chip-select index.
Example: /dev/spigen0.1 would be a child of spibus0, and use cs = 1
The intent is for systems like Raspberry Pi to have a consistent way of
using an SPI interface with a specific cs value from a user application.
Otherwise, there is no consistent way of knowing which cs pin will be
assigned to a particular spigen device. The alternative is to specify
everything in "the right order" in an overlay file, which is less than
ideal. Additionally, this duplicates (to some extent) the way Linux handles
a similar situation with their 'spidev' device, so it would be somewhat
familiar to those who also use Linux.
A new kernel config option, SPIGEN_LEGACY_CDEVNAME, causes the driver to
also create /dev/spigenN device name aliases, with N incrementing in the
order of device instantiation. This is provided to ease the transition
for existing systems using the original naming convention (particularly
when these changes are MFC'd to stable branches).
Differential Revision: https://reviews.freebsd.org/D15301
Notes:
svn path=/head/; revision=335506
|
| |
|
|
|
|
|
|
| |
The PNP info string is the same as the SIMPLEBUS one but driver should
depend on spibus and not simplebus
Notes:
svn path=/head/; revision=335158
|
| |
|
|
|
|
|
|
| |
when the FDT data doesn't enable the device instance, return
BUS_PROBE_NOWILDCARD, the same as for non-FDT systems.
Notes:
svn path=/head/; revision=332292
|
| |
|
|
|
|
|
|
|
|
|
| |
opposed to one that accidentally worked on the one arch I test-compiled for
on my first try).
Reported by: np@, O. Hartmann <ohartmann@walstatt.org>
Pointy hat: ian@
Notes:
svn path=/head/; revision=332259
|
| |
|
|
| |
Notes:
svn path=/head/; revision=332258
|
| |
|
|
|
|
|
|
|
| |
frequency ioctl actually set the corresponding ivar instead of just storing
the value locally in the softc (and then not using it for anything). Also,
return the correct error code if the ioctl cmd is not recognized.
Notes:
svn path=/head/; revision=332233
|
| |
|
|
|
|
|
| |
now that they can be set.
Notes:
svn path=/head/; revision=332231
|
| |
|
|
|
|
|
|
|
|
| |
FDT-based systems, and instead add proper FDT probe code. Because this
driver is freebsd-specific and just provides generic userland access to run
spibus transactions, there is no bindings document to mandate a compatible
string, so just arbitrarily use "freebsd,spigen".
Notes:
svn path=/head/; revision=332219
|
| |
|
|
|
|
|
|
|
|
| |
implementation that must be used, it's just the base system default driver.
Also add a comment noting that we're being more liberal about the bus
frequency property than the dts binding documents require.
Notes:
svn path=/head/; revision=332196
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- Change the description string to "SPI bus" (was "spibus bus").
- This is the default driver for a SPI bus, not a generic implementation,
so return the probe value that indicates such.
- Use device_delete_children() at detach time, instead of a local loop
to enumerate the children and detach each one individually.
Notes:
svn path=/head/; revision=332195
|
| |
|
|
|
|
|
|
|
|
| |
and phase) and the maximum bus speed can be changed. The chip select
number cannot be changed, because the device instances which are children
of spibus are inherently associated with the chip select number they were
instantiated for.
Notes:
svn path=/head/; revision=332194
|
| |
|
|
| |
Notes:
svn path=/head/; revision=332046
|
| |
|
|
|
|
|
| |
so other drivers can refer to them in DRIVER_MODULE() decls.
Notes:
svn path=/head/; revision=329539
|
| |
|
|
| |
Notes:
svn path=/head/; revision=327260
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.
The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
Notes:
svn path=/head/; revision=326255
|
| |
|
|
|
|
|
|
|
|
| |
- Add flag to indicate that device is opened by userland
- Replace "always fail" detach method with proper detach implementation
MFC after: 1 week
Notes:
svn path=/head/; revision=314933
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Merge 3 sequential printf calls into one.
Reported by: rpokala
Reviewed by: rpokala, adrian
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D8795
Notes:
svn path=/head/; revision=312289
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Return BUS_PROBE_NOWILDCARD in probe method to make sure that spigen
attaches only to the device created in identify method.
Before this change spigen probe method used to return 0 which meant it
competed with other drivers to be attached to the devices created for
child nodes of SPI bus node in FDT.
Reported by: Daniel Braniss
MFC after: 1 week
Notes:
svn path=/head/; revision=310492
|
| |
|
|
|
|
|
|
|
|
|
|
| |
As cs is stored in a uint32_t, use the last bit to store the
active high flag as it's unlikely that we will have that much CS.
Reviewed by: loos
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D8614
Notes:
svn path=/head/; revision=310229
|
| |
|
|
|
|
|
|
|
|
| |
Make st_data part of spigen_transfer optional by letting pass zero length
and NULL pointer. SPI controller drivers handle this case fine.
MFC after: 1 week
Notes:
svn path=/head/; revision=310170
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit corrects print of nomatch (newline was too early) and fix
unit number for new child in ar5315_spi (was 0, now is -1 to calculate it
according to actual system state)
Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: ray, loos, mizhka
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D8749
Notes:
svn path=/head/; revision=310017
|
| |
|
|
|
|
|
| |
MFC after: 2 weeks
Notes:
svn path=/head/; revision=308895
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a simple ioctl and mmap API to issue SPI transactions from
userland. It's useful for simple devices (eg spi temperature sensors,
etc) for experimentation.
TODO:
* Write some documentation!
Submitted by: green
Notes:
svn path=/head/; revision=300713
|
| |
|
|
|
|
|
| |
Obtained from: loos
Notes:
svn path=/head/; revision=300712
|
| |
|
|
|
|
|
| |
Pointy hat to: me
Notes:
svn path=/head/; revision=300711
|
| |
|
|
|
|
|
|
|
|
| |
This doesn't yet implement it in the controllers or the transfer
calls, but it's a start.
Obtained from: loos (frequency), ray/zrouter (transfer mode)
Notes:
svn path=/head/; revision=300710
|
| |
|
|
|
|
|
| |
This fixes compilation on riscv with GCC 5.2.0
Notes:
svn path=/head/; revision=298651
|
| |
|
|
|
|
|
| |
None of supported hardware do require that.
Notes:
svn path=/head/; revision=298274
|
| |
|
|
|
|
|
| |
when we want to keep CS asserted for multiple transfers.
Notes:
svn path=/head/; revision=298268
|
| |
|
|
|
|
|
| |
based on the spibus_if.m file.
Notes:
svn path=/head/; revision=278957
|
| |
|
|
|
|
|
|
|
|
|
|
| |
BUS_PROBE_GENERIC and not BUS_PROBE_SPECIFIC (0) so the OFW SPI bus can
attach when enabled. Export the spibus devclass_t and driver_t
declarations.
Submitted by: ray
Approved by: adrian (mentor)
Notes:
svn path=/head/; revision=257064
|
| |
|
|
|
|
|
| |
bridges do.
Notes:
svn path=/head/; revision=239626
|
| |
|
|
| |
Notes:
svn path=/head/; revision=238965
|
| |
|
|
|
|
|
|
|
| |
If I interpret the C standard correctly, the storage specifier should be
placed before the inline keyword. While at it, replace __inline by
inline in the files affected.
Notes:
svn path=/head/; revision=228471
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
one. Interestingly, these are actually the default for quite some time
(bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9)
since r52045) but even recently added device drivers do this unnecessarily.
Discussed with: jhb, marcel
- While at it, use DEVMETHOD_END.
Discussed with: jhb
- Also while at it, use __FBSDID.
Notes:
svn path=/head/; revision=227843
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This reflects actual type used to store and compare child device orders.
Change is mostly done via a Coccinelle (soon to be devel/coccinelle)
semantic patch.
Verified by LINT+modules kernel builds.
Followup to: r212213
MFC after: 10 days
Notes:
svn path=/head/; revision=212413
|
| |
|
|
|
|
|
|
| |
Reviewed by: imp, current@
Approved by: jhb (mentor)
Notes:
svn path=/head/; revision=194020
|
| |
|
|
|
|
|
|
|
| |
name
Reviewed by: imp
Notes:
svn path=/head/; revision=192059
|
| |
|
|
|
|
|
| |
the food chain. devi == NULL is the error condition. Treat it as such.
Notes:
svn path=/head/; revision=163527
|
| |
|
|
| |
Notes:
svn path=/head/; revision=160452
|