History log of /netbsd/sys/dev/i2c/ihidev.c (Results 1 – 25 of 28)
Revision Date Author Comments
# e8b15cb7 12-Feb-2022 riastradh <riastradh@NetBSD.org>

sys: Fix various abuse of struct device internals.

Will help to make struct device opaque later.


# 70f9e62c 15-Jan-2022 skrll <skrll@NetBSD.org>

Trailing whitespace


# a09ada1c 14-Jan-2022 riastradh <riastradh@NetBSD.org>

ihidev(4): Prohibit closing an unopened ihidev.


# 87d7e7f6 14-Jan-2022 riastradh <riastradh@NetBSD.org>

ihidev(4): Avoid reference count overflow.


# 46cb6454 14-Jan-2022 riastradh <riastradh@NetBSD.org>

ihidev(4): Take the lock for ihidev_open, ihidev_close.

Need this to serialize access to sc_state, sc_refcnt.

XXX Should harmonize this with uhidev(4) and tighten assertions.


# cf72ac6c 14-Jan-2022 riastradh <riastradh@NetBSD.org>

ihidev(4): Check kmem_alloc(..., KM_NOSLEEP) for failure.


# 73cf9e9d 14-Jan-2022 riastradh <riastradh@NetBSD.org>

ihidev(4): Allocate report buffer with KM_SLEEP.

Limited to 64k and only happens on attach anyway. Let's not leave a
rake to trip on here.


# 13909718 14-Jan-2022 riastradh <riastradh@NetBSD.org>

ihidev(4): Fix locking and interrupt handler.

- Can't run iic_exec in softint because it does cv_wait, at least on
some i2c controllers -- defer to workqueue instead.

- Fix violations of locking

ihidev(4): Fix locking and interrupt handler.

- Can't run iic_exec in softint because it does cv_wait, at least on
some i2c controllers -- defer to workqueue instead.

- Fix violations of locking rules:
. Do not take a lock at higher IPL than it is defined at!
. Do not sleep under a lock!
. Definitely do not sleep under a spin lock!
In this case, sc_intr_lock was defined at IPL_VM but used at IPL_TTY,
and i2c transactions -- possibly causing sleep for cv_wait -- were
issued under it.

But in this case, the interrupt handler needs only a single bit to
mark whether the work is pending, so just use atomic_swap for that.

- Use an adaptive lock (IPL_NONE) for i2c transactions.

- Detach children, and do so before freeing anything.

show more ...


# beecddb6 07-Aug-2021 thorpej <thorpej@NetBSD.org>

Merge thorpej-cfargs2.


# 3bee0c11 24-Apr-2021 thorpej <thorpej@NetBSD.org>

Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass a

Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).

show more ...


# 01632a17 27-Jan-2021 thorpej <thorpej@NetBSD.org>

Use DEVICE_COMPAT_EOL.


# 95932c5d 26-Jan-2021 thorpej <thorpej@NetBSD.org>

Now that the ACPI layer no longer does this for us, evaluate the _DSM
that returns the HID descriptor address at attach time.


# d5e53f06 26-Jan-2021 thorpej <thorpej@NetBSD.org>

Don't map ACPI _HID / _CID strings to "compatible" strings from the
Device Tree bindings. Just pass those strings in the standard
most-specific-to-least-specific order to the drivers and let them
de

Don't map ACPI _HID / _CID strings to "compatible" strings from the
Device Tree bindings. Just pass those strings in the standard
most-specific-to-least-specific order to the drivers and let them
deal.

show more ...


# 67422ab2 26-Jan-2021 thorpej <thorpej@NetBSD.org>

Back out unintended change in previous.


# d068de0e 25-Jan-2021 thorpej <thorpej@NetBSD.org>

Since we're using designated initialisers for compat data, we should
use a completely empty initializer for the sentinel.


# 3f1bcda8 17-Jan-2021 thorpej <thorpej@NetBSD.org>

Use designated initializers and a consistent termination style in
compat_data[].


# 3bac8e88 09-Jan-2020 thorpej <thorpej@NetBSD.org>

Re-enable the intr / mask / softint / unmask dance now that the x86
interrupt issue is fixed. Verified working by ryoon@ (thanks!).


# 72e2fd19 25-Dec-2019 thorpej <thorpej@NetBSD.org>

Revert previous until issues can be sorted out.


# 3f75b282 22-Dec-2019 thorpej <thorpej@NetBSD.org>

The hid-over-i2c spec specifies that compliant devices use level-sensitive
interrupts. However, it's not safe to do i2c bus access in hard interrupt
context, and we must read the event data off the

The hid-over-i2c spec specifies that compliant devices use level-sensitive
interrupts. However, it's not safe to do i2c bus access in hard interrupt
context, and we must read the event data off the device in order to clear
the interrupt condition.

Address this by using acpi_intr_mask() to mask off the interrupt source
while a softint is pending to service the events, re-enabling it once
servicing is completed.

While here, re-factor the interrupt setup / tear-down code a bit to
eventually once day simplify supporting the FDT bindings for hid-over-i2c.

show more ...


# 68befe26 01-Oct-2019 chs <chs@NetBSD.org>

in many device attach paths, allocate memory with KM_SLEEP instead of KM_NOSLEEP
and remove code to handle failures that can no longer happen.


# 33bb2c4f 26-Sep-2019 bouyer <bouyer@NetBSD.org>

Abort attach if acpi_intr_establish() fails. From K. Schreiner on
current-users@.


# 488c5b15 16-Nov-2018 jmcneill <jmcneill@NetBSD.org>

Use acpi_md_intr_establish/disestablish to handle device IRQs. The existing
code abused AcpiOsInstallInterruptHandler, which is meant for installing
the SCI handler.


# c3da1228 15-Nov-2018 jakllsch <jakllsch@NetBSD.org>

Correctly handle signed/unsigned quantities in kernel HID parser.

Should fix PR kern/53605.


# 0089a6b2 26-Jun-2018 thorpej <thorpej@NetBSD.org>

In my quest to make device_compatible_entry (and associated goo)
super-general, it turns out I also made it a little to cumbersome
to use (if my tired fingers are any indication). So, this is a
cour

In my quest to make device_compatible_entry (and associated goo)
super-general, it turns out I also made it a little to cumbersome
to use (if my tired fingers are any indication). So, this is a
course-correction -- one string per entry (like of_compat_data,
which it will soon replace), and remove the over-verbose macros.

show more ...


# b3c1046b 18-Jun-2018 thorpej <thorpej@NetBSD.org>

- Rename iic_compat_match() to iic_compatible_match() and change it
to use the new device_compatible_match() routine. A pointer to
the matching device_compatible_entry is returned if a match is

- Rename iic_compat_match() to iic_compatible_match() and change it
to use the new device_compatible_match() routine. A pointer to
the matching device_compatible_entry is returned if a match is
found.
- Adjust iic_use_direct_match() accordingly.
- i2c drivers now provide device_compatible_entry tables when performing
direct-config matching.
- In the dsrtc driver, take advantage of this new capability to greatly
simplify model selection.

(I'm coming for you next, of_compat_data...)

show more ...


12