History log of /freebsd/sys/dev/spibus/spibus.c (Results 1 – 25 of 63)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 0ac15e47 02-Jan-2025 John Baldwin <jhb@FreeBSD.org>

spibus: Use bus_generic_* directly instead of wrappers

Differential Revision: https://reviews.freebsd.org/D47971


# 3ddaf820 02-Jan-2025 John Baldwin <jhb@FreeBSD.org>

Use bus_generic_detach instead of device_delete_children in detach

While here, check for errors from bus_generic_detach and move it to
the start of detach if necessary.

Differential Revision: https

Use bus_generic_detach instead of device_delete_children in detach

While here, check for errors from bus_generic_detach and move it to
the start of detach if necessary.

Differential Revision: https://reviews.freebsd.org/D47969

show more ...


# 18250ec6 06-Dec-2024 John Baldwin <jhb@FreeBSD.org>

Replace calls to bus_generic_attach with bus_attach_children

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47675


Revision tags: release/14.2.0
# 84553ccd 01-Nov-2024 John Baldwin <jhb@FreeBSD.org>

spibus: Use a bus_child_deleted method to free ivars for children

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47373


Revision tags: release/13.4.0, release/14.1.0, release/13.3.0
# fdafd315 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

sys: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remov

sys: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix

show more ...


Revision tags: release/14.0.0
# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 7d380b98 03-Aug-2023 Vladimir Kondratyev <wulf@FreeBSD.org>

spibus(4): Add support for ACPI-based children enumeration

When spibus is attached as child of Intel SPI controller it scans all
ACPI nodes for "SPI Serial Bus Connection Resource Descriptor" descri

spibus(4): Add support for ACPI-based children enumeration

When spibus is attached as child of Intel SPI controller it scans all
ACPI nodes for "SPI Serial Bus Connection Resource Descriptor" described
in section 19.6.126 of ACPI specs.
If such a descriptor is found, SPI child is added to spibus, it's SPI
chip select, mode, clock, IRQ resource and ACPI handle are added to ivars.
Existing ACPI bus-hosted child is deleted afterwards.
Apple ACPI SPI extensions are supported.

Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41248

show more ...


# c6889cbf 03-Aug-2023 Vladimir Kondratyev <wulf@FreeBSD.org>

spibus(4): Allow IRQ resource to be released

IRQ Resource is allocated on spibus(4). We must release it here too
rather than propagate request down the tree.

Fixes: 4dd8db62e9d3 ("Add IRQ resource

spibus(4): Allow IRQ resource to be released

IRQ Resource is allocated on spibus(4). We must release it here too
rather than propagate request down the tree.

Fixes: 4dd8db62e9d3 ("Add IRQ resource to SPIBUS")

MFC after: 1 week
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41243

show more ...


# 1e55a130 03-Aug-2023 Vladimir Kondratyev <wulf@FreeBSD.org>

spibus(4): Skip bus_generic_detach() on device detach

device_delete_children() detaches all children too.

MFC after: 1 month
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41

spibus(4): Skip bus_generic_detach() on device detach

device_delete_children() detaches all children too.

MFC after: 1 month
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41240

show more ...


# 3c086734 24-Apr-2023 Val Packett <val@packett.cool>

spibus: extend API: add cs_delay ivar, KEEP_CS and NO_SLEEP flags

These feature are required for an upcoming Apple MacBook topcase
(HID over SPI) driver:

A delay after toggling CS is required to av

spibus: extend API: add cs_delay ivar, KEEP_CS and NO_SLEEP flags

These feature are required for an upcoming Apple MacBook topcase
(HID over SPI) driver:

A delay after toggling CS is required to avoid anomalies like an extra
junk byte in front of the message. Keeping CS asserted is required to
be able to read a status report after writing a command. (The device
won't return the status if CS was deasserted.)

Sleep is not allowed in the interrupt context where the Apple input
driver runs its transactions. Use a flag to tell the SPI driver to
avoid mtx_sleep.

Reviewed by: manu (ok to SPI part of larger patch)
MFC afret: 1 month
Differential revision: https://reviews.freebsd.org/D29534

show more ...


Revision tags: release/13.2.0, release/12.4.0, release/13.1.0
# 5f31d14a 09-May-2022 John Baldwin <jhb@FreeBSD.org>

Remove unused spibus_devclass and ofw_spibus_devclass.


Revision tags: release/12.3.0
# ddfc9c4c 23-Jun-2021 Warner Losh <imp@FreeBSD.org>

newbus: Move from bus_child_{pnpinfo,location}_src to bus_child_{pnpinfo,location} with sbuf

Now that the upper layers all go through a layer to tie into these
information functions that translates

newbus: Move from bus_child_{pnpinfo,location}_src to bus_child_{pnpinfo,location} with sbuf

Now that the upper layers all go through a layer to tie into these
information functions that translates an sbuf into char * and len. The
current interface suffers issues of what to do in cases of truncation,
etc. Instead, migrate all these functions to using struct sbuf and these
issues go away. The caller is also in charge of any memory allocation
and/or expansion that's needed during this process.

Create a bus_generic_child_{pnpinfo,location} and make it default. It
just returns success. This is for those busses that have no information
for these items. Migrate the now-empty routines to using this as
appropriate.

Document these new interfaces with man pages, and oversight from before.

Reviewed by: jhb, bcr
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D29937

show more ...


Revision tags: release/13.0.0
# 4dd8db62 17-Dec-2020 Emmanuel Vadot <manu@FreeBSD.org>

Add IRQ resource to SPIBUS

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

Add IRQ resource to SPIBUS

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

show more ...


Revision tags: release/12.2.0, release/11.4.0
# f86e6000 04-Dec-2019 Warner Losh <imp@FreeBSD.org>

Regularize my copyright notice

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 clai

Regularize my copyright notice

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.

show more ...


Revision tags: release/12.1.0, release/11.3.0
# b18a4cca 05-Mar-2019 Enji Cooper <ngie@FreeBSD.org>

MFhead@r344786


# 844fc3e9 04-Mar-2019 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r344549 through r344775.


# 47a7da76 26-Feb-2019 Ian Lepore <ian@FreeBSD.org>

Set maximum bus clock speed from hints when attaching hinted spibus(4) children.

Some devices (such as spigen(4)) document that this works, but it appears that the
code to implement it never got add

Set maximum bus clock speed from hints when attaching hinted spibus(4) children.

Some devices (such as spigen(4)) document that this works, but it appears that the
code to implement it never got added.

show more ...


Revision tags: release/12.0.0, release/11.2.0
# 1fcf4de0 21-Jun-2018 Ian Lepore <ian@FreeBSD.org>

Incorporate bus and chip select numbers into spigen(4) cdev names. Rather
than assigning spigen device names in order of creation, this uses a device
name that corresponds to the owning spibus and c

Incorporate bus and chip select numbers into spigen(4) cdev names. Rather
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

show more ...


# c1ec6ac5 07-Apr-2018 Ian Lepore <ian@FreeBSD.org>

A couple minor improvements to spibus.c...

- 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

A couple minor improvements to spibus.c...

- 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.

show more ...


# 392bffb9 07-Apr-2018 Ian Lepore <ian@FreeBSD.org>

Add support for writing/changing spi device ivars. The SPI mode (polarity
and phase) and the maximum bus speed can be changed. The chip select
number cannot be changed, because the device instances

Add support for writing/changing spi device ivars. The SPI mode (polarity
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.

show more ...


Revision tags: release/10.4.0, release/11.1.0
# 721fc9d8 16-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r312207 through r312308.


# a61b4567 16-Jan-2017 Enji Cooper <ngie@FreeBSD.org>

MFhead@r312305


# f73628e7 16-Jan-2017 Michael Zhilin <mizhka@FreeBSD.org>

[spibus] small code refactoring

Merge 3 sequential printf calls into one.

Reported by: rpokala
Reviewed by: rpokala, adrian
Approved by: adrian (mentor)
Differential Revision: https://reviews.freeb

[spibus] small code refactoring

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

show more ...


# 3ffd3530 16-Dec-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r309817 through r310168.


# 167a228d 13-Dec-2016 Michael Zhilin <mizhka@FreeBSD.org>

[spi] reformat message and ar5315_spi minor fix

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
accord

[spi] reformat message and ar5315_spi minor fix

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

show more ...


123