summaryrefslogtreecommitdiff
path: root/sys/dev/i2c
AgeCommit message (Collapse)Author
2024-10-18Instead of always following up "power on" with a "reset", onlyTobias Heider
send a single reset during attach. We have discovered that some devices such as the built-in keyboard on the Thinkpad T14s Gen 6 don't like getting more than one reset sent or they become unresponsive. This has been in snaps for a while and hasn't caused any major regressions so we are confident the extra reset is not needed on most hardware. feedback from kettenis@ ok deraadt@ mlarkin@
2024-10-09make attachments use pre-existing activate functions; ok deraadt@Jonathan Gray
2024-09-04Fix some spelling.Marcus Glocker
Input and ok jmc@, jsg@
2024-08-19now that suspend operations are done as quiesce, we can try to useTheo de Raadt
the MXT_T7_POWER_MODE_DEEP_SLEEP operation.
2024-08-19Use M_WAITOK where we can; this includes during autoconf where the onlyMark Kettenis
realistic option is to panic if we're doing smallish allocations and run out of memory. ok deraadt@
2024-08-18Don't short-circuit interrupt handling when the sc_dying flag is set. JustMark Kettenis
don't forward reports to the child drivers instead. This fixes an issue with hardware that sends an interrupt in response to a reset request when a level-triggered interrupt is used. In that case the interrupt would just keep triggering when we issue a reset when we resume (when sc_dying is set) since we didn't clear the interrupt condition by reading from the device. ok mlarkin@, deraadt@
2024-08-18add missing child activate handling, found due to idiom inspectionTheo de Raadt
tested by phessler, input from kettenis
2024-08-17icc_detach was not listed in cfattachTheo de Raadt
2024-07-22remove unneeded prototypes for functions in other filesJonathan Gray
2024-05-28remove space between function names and argument listJonathan Gray
2024-05-13remove prototypes with no matching functionJonathan Gray
ok mpi@
2023-08-12Don't power down if the device is already opened. This happens when anMark Kettenis
ikbd(4) attaches and becomes the console keyboard. We would power down the device but never power it on again when userland opened ikbd(4) as an input device since that is only done on the first open. The result was a non-functioning keyboard if the hardware actually implemented the power down command. A lot of hardware actually doesn't (which is why this wasn't noticed for some time) but the ASUS X205T does. ok miod@
2023-07-21add missing newline on successful attachment, spotted by bmercerJoshua Stein
remove duplicate prefixes on unsuccessful attachment, wrap at 80, other minor nits
2023-07-08Add ietp driver for Elantech I2C touchpadsJoshua Stein
From Vladimir Serbinenko
2023-03-08Delete obsolete /* ARGSUSED */ lint comments.Philip Guenther
ok miod@ millert@
2022-11-11Add icc(4) to handle Customer Control keyboards attached to i2c bus.Matthieu Herrb
ok anton@ patrick@
2022-10-25Calculate approx. battery re-charge time.Marcus Glocker
2022-10-24Fix comment; sconds -> secondsMarcus Glocker
2022-10-23Initial apm/sensor driver for the PiJuice HAT UPS, to feedback batteryMarcus Glocker
status information. ok deraadt@
2022-10-20Remove the single part string for DS1339, since that is only required onMarcus Glocker
sparc64 because OpenFirmware doesn't support the <vendor>,<part> compatible pattern. We don't expect this chip to turn up on sparc64. Suggested and ok kettenis@
2022-10-18Add support for the DS1339 RTC, like found on the PiJuice.Marcus Glocker
From Michal Mynar -- Thanks! ok deraadt@
2022-10-15Convert remaining I2C RTC drivers to use todr_attach().Mark Kettenis
These all get a quality of 1000 since these are supposed to be battery backed and almost certainly what the hardware designers want us to use. ok mglocker@, jsg@
2022-10-12Extend struct todr_chip_handle with a todr_quality member. This allows usMark Kettenis
to assign a quality to RTC implementation and pick the "best" RTC if a system has multiple RTCs (or multiple interfaces to an RTC). This allows us to prefer a battery-backed I2C RTC over an RTC that is part of the SoC which is only running of the SoC is powered. It also allows us to work around issues with firmware RTC interfaces that may lie to us or even crash the system. This change makes sure the todr_quality member of the struct is always initialized. In most cases the quality will be set to zero; further adjustments of the quality for specific subsystems/architectures will follow. ok cheloha@, patrick@
2022-09-03Allow ikbd(4) to become the console keyboard.Mark Kettenis
ok miod@
2022-08-31Introduce iic_intr_disestablish() and use it in ihidev(4).Mark Kettenis
ok jcs@
2022-05-20Rename hid_none to hid_all as it represents all possible hid kinds byAnton Lindqvist
now.
2022-04-08lm, uguru, fins, wbenv: constify sensor tablesChristian Weisgerber
ok miod@
2022-04-06constify struct cfattachChristian Weisgerber
2022-02-09Add iic_is_compatible() for matching I2C devicesVisa Hankala
When using device trees, the ia_name field of struct i2c_attach_args points to the first string of the device node's "compatible" array. However, in many cases it would be preferable to use the last, most general "compatible" entry as a device matching criterion. Enable more flexible device matching by permitting ia_name to point to the raw "compatible" data which is a concatenation of NUL-terminated strings. I2C bus code will supply the data and set ia_name and ia_namelen. I2C device drivers will use iic_is_compatible() to check matches. This method is also backwards compatible with the old, direct use of ia_name. Prompted by a related patch from kettenis@. OK kettenis@
2022-01-09spellingJonathan Gray
feedback and ok tb@ jmc@ ok ratchov@
2021-11-22Add pcyrtc(4), a driver for the NXP PCF85063A/TP RTC chips.Mark Kettenis
ok patrick@
2021-11-22Remove unused header files and make some cosmetic changes.Mark Kettenis
ok patrick@
2021-10-26Improve unhibernate performance (30% on some machines, another upcoming diffTheo de Raadt
shows gains up to 50%) by skipping attach of irrelevant devices, which are tagged CD_SKIPHIBERNATE in the per-driver cfdriver. In particular, usb devices are not attached, so they don't need to detach during the suspend-unpack-resume. New bootblocks are required (which tell the kernel it's job is unhibernate before configure runs) tested by various
2021-08-26Request wMaxInputLength bytes of data on each interrupt which shouldJoshua Stein
already account for the two-byte length and one-byte report id, rather than adding them ourself and requesting wMaxInputLength + 3. Fixes dwiic timeouts requesting data from at least one touchpad. Tested by various
2021-06-23Add titmp(4), a driver for the TI TMP451 temperature sensor.Mark Kettenis
ok deraadt@
2021-04-24Remove unused function pointers from `todr_handle'.Martin Pieuchot
from miod@
2021-01-22ims: an actual i2c-connected mouse is unlikelyJoshua Stein
Claim to be a touchpad instead, which sets up ims devices in X11 to be more like touchpads. ok mglocker
2021-01-13Add support for the HYM8563 RTC, which is a PCF8563 clone.Mark Kettenis
ok kurt@
2020-11-14Extend pcamux(4) with ACPI support. So far pcamux(4) has assumed it'sPatrick Wildt
always matched on an FDT-capable device, but the HoneyComb LX2K seems to have a PCA9547 and provides it as NXP0002 HID. This means we know if it's ACPI or FDT based on the name passed. This is required to be able to make two acpitz(4) nodes work, since the thermel sensors are behind the mux. ok kettenis@
2020-11-13Add support for the PCA9547 I2C mux to pcamux(4). In comparison toPatrick Wildt
the PCA954[68], this is a mux instead of a switch and can only have one active channel at a time. On the bright side, we treat switches like a mux, so only the bits have to be set a little bit differently. ok kettenis@
2020-10-23Add support for the Micro Crystal RV4162. This variant holds thePatrick Wildt
square wave frequency control bits in the Day Of Week register. To make sure we don't fudge with those bits, only reset those that hold the day and keep the rest as is. ok kettenis@
2020-09-30Move mfokclock(4) from loongson to sys/dev/i2c so that it be used by morePatrick Wildt
platforms than just loongson. Rename it to mfokrtc(4) for consistency with other RTC drivers. Make it match on st,m41t83, since that was the chip for which the driver was written for. More compatible strings can be added for each chip of the series verified to behave the same. Discussed with kettenis@ Compile tested on loongson by kn@ Tested on loongson by and ok visa@
2020-09-29Add support for the PCA9546 I2C switch to pcamux(4). In comparison toPatrick Wildt
PCA9548, this variant supports only 4 instead of 8 channels. ok kettenis@
2020-09-29The pcamux(4) device tree node's children are the individual channels,Patrick Wildt
which we each treat as an I2C bus. While scanning these, we need to use each channel's node as starting point instead of the pcamux(4) node. This fixes finding and attaching devices connected to these channels. ok kettenis@
2020-08-26Declare hw_{prod,serial,uuid,vendor,ver} in <sys/systm.h>.Visa Hankala
OK deraadt@, mpi@
2020-07-09On some laptops that have a Windows Precision Touchpad (imt) andJoshua Stein
also a trackstick or separate physical buttons, imt was claiming all report ids of the ihidev device preventing the trackstick/buttons from attaching as a separate ims device on other report ids. Just claim the report ids that imt needs and let ims attach to others it may find. Fixes two Dell Latitude laptops and tested in snaps for a bit.
2020-06-18Add pcamux(4), a driver for the PCA8548 I2C switch.Mark Kettenis
ok patrick@
2020-04-29Enable the trickle charger after setting the control register.Patrick Wildt
2020-04-29Update the trickle charger diode defines based on the datasheet, andPatrick Wildt
enable the trickle charger.
2020-04-29Writing and reading time has been broken in abcrtc(4) as well. I wasPatrick Wildt
being too clever trying to use the SMBus block reads/writes. Instead the registers were written with an offset: Seconds were stored in the minutes, minutes were stored in the hours. No wonder time was ticking so slowly. Removing the bogus length field and simply writing/reading the time register values is enough. ok kettenis@