Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754860Ab1CMEY2 (ORCPT ); Sat, 12 Mar 2011 23:24:28 -0500 Received: from mail-iy0-f174.google.com ([209.85.210.174]:38304 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753376Ab1CMEYD (ORCPT ); Sat, 12 Mar 2011 23:24:03 -0500 From: Bill Gatliff To: linux-kernel@vger.kernel.org, linux-embedded@vger.kernel.org Cc: Bill Gatliff Subject: [PWM v8 0/3] Implement a generic PWM framework Date: Sat, 12 Mar 2011 22:24:06 -0600 Message-Id: <1299990249-18264-1-git-send-email-bgat@billgatliff.com> X-Mailer: git-send-email 1.7.2.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3799 Lines: 92 This patch series contains the eigth attempt at implementation of a generic PWM device interface framework. Think gpiolib, but for devices and pseudo-devices that generate pulse-wave-modulated outputs. Compared to the previous version, this patch series: * Eliminates redundant registration and request APIs * Fundamentally changes how device structures are managed * Adds a module owner to pwm_device_ops The struct device structures are now embedded into struct pwm_device, and are allocated, initialized, and registered during pwm_register(); struct device unregistration takes place during pwm_unregister(). This should significantly reduce the likelihood that a struct pwm_device get unregistered during sysfs interaction---though I am not 100% sure I have all the cases covered. Reviewers welcome! Module_get() and module_put() are now called when PWM devices are requested and released, respectively. This prevents device operation module removal while a PWM device is in use. A git tree containing these patches may be found here: http://git.billgatliff.com/pwm.git git://git.billgatliff.com/pwm.git Functionally-speaking, this series has regressed somewhat from previous versions because I am currently focusing my attention on the API itself. I include implementations only for GPIO+hrtimer devices and the Atmel PWMC peripheral as references in this series; I will post patches for LED drivers, PXA, Samsung, etc. devices once I know that the API itself is on its way to mainline. (I believe that the two reference implementations sufficiently confirm the utility of the API itself). Conversion of existing machines and platforms to this API is relatively straightforward, but must be done in conjunction with the various users of PWM (LEDs, etc.) because PWM devices will now be referenced by struct pwm_device structures, rather than integers. Thus, there is potentially significant effort involved because platform data structures, etc. must be updated. I have (re)started that effort twice already, and I prefer not to do so again until the target API is stable. The code in this series is significantly clearer and more straightforward than previous versions. Thanks to everyone who helped me with this refactoring! I'm pretty convinced that the code you see here is at last suitable for pulling into mainline. Finally, the attached code CAN be used to control devices that drive stepper motors and the like, but doing so is discouraged as I am anticipating a request to develop an API specifically for such situations. Regards, b.g. Bill Gatliff (3): PWM: Implement a generic PWM framework PWM: GPIO+hrtimer device emulation PWM: Atmel PWMC driver Documentation/pwm.txt | 289 ++++++++++++++++++++++ MAINTAINERS | 8 + drivers/Kconfig | 2 + drivers/Makefile | 2 + drivers/pwm/Kconfig | 29 +++ drivers/pwm/Makefile | 7 + drivers/pwm/atmel-pwmc.c | 452 +++++++++++++++++++++++++++++++++++ drivers/pwm/gpio-pwm.c | 332 ++++++++++++++++++++++++++ drivers/pwm/pwm.c | 594 ++++++++++++++++++++++++++++++++++++++++++++++ include/linux/pwm/pwm.h | 143 +++++++++++ 10 files changed, 1858 insertions(+), 0 deletions(-) create mode 100644 Documentation/pwm.txt create mode 100644 drivers/pwm/Kconfig create mode 100644 drivers/pwm/Makefile create mode 100644 drivers/pwm/atmel-pwmc.c create mode 100644 drivers/pwm/gpio-pwm.c create mode 100644 drivers/pwm/pwm.c create mode 100644 include/linux/pwm/pwm.h -- 1.7.2.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/