aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/pwm
Commit message (Collapse)AuthorAgeFilesLines
* pwm_backlight: Fix 32 bits buildEmmanuel Vadot2020-10-031-4/+4
| | | | | | | Reported by: jenkins, mjg Notes: svn path=/head/; revision=366386
* Add pwm_backlightEmmanuel Vadot2020-10-021-0/+311
| | | | | | | | | | | Driver for pwm-backlight compatible device. Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26252 Notes: svn path=/head/; revision=366371
* pwm: clean up empty lines in .c and .h filesMateusz Guzik2020-09-012-2/+1
| | | | Notes: svn path=/head/; revision=365170
* Remove "all rights reserved" from copyright for the file I own.Emmanuel Vadot2019-12-035-5/+0
| | | | | | | | Some of the files have both me and Jared McNeill and he gave me permission to remove it from his files too. Notes: svn path=/head/; revision=355357
* Handle labels specified with hints even on FDT systems. Hints are theIan Lepore2019-06-181-14/+5
| | | | | | | | easiest thing for a user to control (via loader.conf or kenv+kldload), so handle them in addition to any label specified via the FDT data. Notes: svn path=/head/; revision=349174
* Remove everything related to channels from the pwmc public interface, nowIan Lepore2019-06-182-10/+2
| | | | | | | | that there is a pwmc(4) instance per channel and the channel number is maintained as a driver ivar rather than being passed in from userland. Notes: svn path=/head/; revision=349164
* Put the pwmc cdev filenames under the pwm directory along with any labelIan Lepore2019-06-171-1/+1
| | | | | | | | | names. I.e., everything related to pwm now goes in /dev/pwm. This will make it easier for userland tools to turn an unqualified name into a fully qualified pathname, whether it's the base pwmcX.Y name or a label name. Notes: svn path=/head/; revision=349143
* Add back a const qualifier I somehow fumbled away between test-buildingIan Lepore2019-06-171-1/+1
| | | | | | | and committing recent changes. Notes: svn path=/head/; revision=349132
* Add ofw_pwmbus to enumerate pwmbus devices on systems configured with fdtIan Lepore2019-06-174-12/+292
| | | | | | | data. Also, add fdt support to pwmc. Notes: svn path=/head/; revision=349130
* Rework pwmbus and pwmc so that each child will handle a single PWM channel.Ian Lepore2019-06-163-29/+234
| | | | | | | | | | | | | | | | | | | | | Previously, there was a pwmc instance for each instance of pwm hardware regardless of how many pwm channels that hardware supported. Now there will be a pwmc instance for each channel when the hardware supports multiple channels. With a separate instance for each channel, we can have "named channels" in userland by making devfs alias entries in /dev/pwm. These changes add support for ivars to pwmbus, and use an ivar to track the channel number for each child. It also adds support for hinted children. In pwmc, the driver checks for a label hint, and if present, it's used to create an alias for the cdev in /dev/pwm. It's not anticipated that hints will be heavily used, but it's easy to do and allows quick ad-hoc creation of named channels from userland by using kenv to create hint.pwmc.N.label= hints. Upcoming changes will add FDT support, and most labels will probably be specified that way. Notes: svn path=/head/; revision=349119
* Rename pwmbus.h to ofw_pwm.h, because after all the recent changes, thereIan Lepore2019-06-163-7/+4
| | | | | | | | | | | is nothing left in the file that related to pwmbus at all. It just contains prototypes for the functions implemented in dev/pwm.ofw_pwm.c, so name it accordingly and fix the include protect wrappers to match. A new pwmbus.h will be coming along in a future commit. Notes: svn path=/head/; revision=349115
* This code no longer uses fdt/ofw stuff, no need to include ofw headers.Ian Lepore2019-06-161-3/+0
| | | | Notes: svn path=/head/; revision=349093
* Make channel number unsigned, and spell unsigned int u_int. This shouldIan Lepore2019-06-161-3/+3
| | | | | | | have been part of r349088. Notes: svn path=/head/; revision=349092
* Make pwm channel numbers unsigned.Ian Lepore2019-06-154-20/+20
| | | | Notes: svn path=/head/; revision=349088
* Restructure the pwm device hirearchy and interfaces.Ian Lepore2019-06-156-192/+50
| | | | | | | | | | | | | | | | | | | | | The pwm and pwmbus interfaces were nearly identical, this merges them into a single pwmbus interface. The pwmbus driver now implements the pwmbus interface by simply passing all calls through to its parent (the hardware driver). The channel_count method moves from pwm to pwmbus, and the get_bus method is deleted (just no longer needed). The net effect is that the interface for doing pwm stuff is now the same regardless of whether you're a child of pwmbus, or some random driver elsewhere in the hierarchy that is bypassing the pwmbus layer and is talking directly to the hardware driver via cross-hierarchy connections established using fdt data. The pwmc driver is now a child of pwmbus, instead of being its sibling (that's why the get_bus method is no longer needed; pwmc now gets the device_t of the bus using device_get_parent()). Notes: svn path=/head/; revision=349086
* Destroy the cdev on device detach. Also, make the driver and devclassIan Lepore2019-06-151-2/+6
| | | | | | | static, because nothing outside this file needs them. Notes: svn path=/head/; revision=349085
* Rename the channel_max method to channel_count, because that's what it'sIan Lepore2019-06-153-3/+3
| | | | | | | returning. (If the channel count is 2, then the max channel number is 1.) Notes: svn path=/head/; revision=349084
* Spell unsigned int as u_int and channel as chan; eliminates the need to wrapIan Lepore2019-06-151-18/+18
| | | | | | | some long lines. Notes: svn path=/head/; revision=349082
* Unwrap prototype lines so that return type and function name are on theIan Lepore2019-06-151-8/+4
| | | | | | | same line. No functional changes. Notes: svn path=/head/; revision=349081
* Make pwmbus driver and devclass vars static; they're not mentioned in anyIan Lepore2019-06-151-2/+2
| | | | | | | header file, so they can't be used outside this file anyway. Notes: svn path=/head/; revision=349080
* Use device_delete_children() instead of a locally-rolled copy of it thatIan Lepore2019-06-151-12/+4
| | | | | | | leaks the device-list memory. Notes: svn path=/head/; revision=349076
* Remove pwmbus_attach_bus(), it no longer has any callers. Also remove aIan Lepore2019-06-152-33/+0
| | | | | | | couple prototypes for functions that never existed (and never will). Notes: svn path=/head/; revision=349075
* Move/rename the sys/pwm.h header file to dev/pwm/pwmc.h. The file containsIan Lepore2019-06-152-1/+54
| | | | | | | | | ioctl definitions and related datatypes that allow userland control of pwm hardware via the pwmc device. The new name and location better reflects its assocation with a single device driver. Notes: svn path=/head/; revision=349074
* Do not include pwm.h here, it is purely a userland interface file containingIan Lepore2019-06-152-5/+0
| | | | | | | ioctl defintions for the pwmc driver. It is not part of the pwmbus interface. Notes: svn path=/head/; revision=349073
* pwm: Convert period and duty to unsigned intEmmanuel Vadot2018-12-143-10/+10
| | | | | | | | | We don't need a 64 bits value to store nanoseconds Discused with: ian, jhibbits Notes: svn path=/head/; revision=342087
* Add a pwm subsystem so we can configure pwm controller from kernel and userland.Emmanuel Vadot2018-12-126-0/+795
The pwm subsystem consist of API for PWM controllers, pwmbus to register them and a pwm(8) utility to talk to them from userland. Reviewed by: oshgobo (capsicum), bcr (manpage), 0mp (manpage) Differential Revision: https://reviews.freebsd.org/D17938 Notes: svn path=/head/; revision=342003