From patchwork Tue Mar 26 17:31:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 1065832 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="IpghrISP"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44TJ9N6bvZz9sPP for ; Wed, 27 Mar 2019 04:32:24 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731997AbfCZRcX (ORCPT ); Tue, 26 Mar 2019 13:32:23 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:55816 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726207AbfCZRcX (ORCPT ); Tue, 26 Mar 2019 13:32:23 -0400 Received: by mail-wm1-f68.google.com with SMTP id o25so13539795wmf.5 for ; Tue, 26 Mar 2019 10:32:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=U6mNJVRahN3/698cZnbbqdiNFXCb+H8dbQ6cUR21avs=; b=IpghrISP5oKHl7m5A4Tha7uekQmYhSZp185/et+HW5FIsQSs/nWjpCmm2uRb9z1noc INVzxsvGFnEpksOd0TnO2mTjrx2Zt7DPFHHuOSupfMbZcGEx86nS1j7MqCqf9HXMf5mD Fx/3fw+xlde3yW723wf5JI+nNm1a1XNmUto7ZgYG4eMJeY3wEVdmzyaBqIZtmo2YhvbW +RFFRCbhcna/jxqnsaLNPEkATBRf0VCBWd4fL7G1UxUcnW/XeCxWd7BDGGgiwLtMmpKA HJpjYWJ/gBei7lsLryt7KfqNp/WBVFc0EqnDYda1EnEz7bubbMd4IYT+Q707E8RtfM9J Ab3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=U6mNJVRahN3/698cZnbbqdiNFXCb+H8dbQ6cUR21avs=; b=dJZ8tO/3HKy0ZWPJmHmN+4pF4MEZrO/TkN9OmfmK0UMGnp1+u+agxREd/i9n4j1xVm QGa2+QDVCDkFOimzNLv7MpheIWHSRqaxOAu1lT+gch6F9Tpi1jncRrb8m8bM3mw4X7Pz KlGtv3AbAaK/AqxL9vkK4B5iLJTUBo7F+JldBIrjqUjENbto+U4f3TfQTeaI6nANykSa lkiw3ge2hf2+qnBTN5Ks/K9b3SqBXcz+6pKmHSgQsztKkZcC7D6ZimTRqT0L+LG1qiK6 fTPTJ1TA+LzHGPwlnIuD2eTZd14Cg5QtgqNa5iLLy+WRi7brRCZxC99nC8cCH6K2GCOs ddQA== X-Gm-Message-State: APjAAAVp05VCE9+FZkvOGOZpBXIeIlninxjcJM1LL7JXt4BtDre56Be5 m5sZvcjuBo7od0ZwVpMtV1VXBw== X-Google-Smtp-Source: APXvYqwi00ZuNH9xjVNUexGJVIsPrAnsgsFhSuDEWCP9kNlplLPLDdbXkUhutIkEFDxTw6opXoOtPA== X-Received: by 2002:a1c:9d8f:: with SMTP id g137mr16308998wme.26.1553621540824; Tue, 26 Mar 2019 10:32:20 -0700 (PDT) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id 4sm2534541wmg.12.2019.03.26.10.32.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Mar 2019 10:32:20 -0700 (PDT) From: Bartosz Golaszewski To: Rob Herring , Mark Rutland , Linus Walleij , Dmitry Torokhov , Jacek Anaszewski , Pavel Machek , Lee Jones , Sebastian Reichel , Liam Girdwood , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, linux-pm@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v7 00/11] mfd: add support for max77650 PMIC Date: Tue, 26 Mar 2019 18:31:57 +0100 Message-Id: <20190326173208.30614-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Bartosz Golaszewski This series adds support for max77650 ultra low-power PMIC. It provides the core mfd driver and a set of five sub-drivers for the regulator, power supply, gpio, leds and input subsystems. Patches 1-4 add the DT binding documents. Patch 5 documents mfd_add_devices(). Patches 6-10 add all drivers. Last patch adds a MAINTAINERS entry for this device. The regulator part is already upstream. v1 -> v2: ========= General: - use C++ style comments for the SPDX license identifier and the copyright header - s/MODULE_LICENSE("GPL")/MODULE_LICENSE("GPL v2")/ - lookup the virtual interrupt numbers in the MFD driver, setup resources for child devices and use platform_get_irq_byname() in sub-drivers - picked up review tags - use devm_request_any_context_irq() for interrupt requests LEDs: - changed the max77650_leds_ prefix to max77650_led_ - drop the max77650_leds structure as the only field it held was the regmap pointer, move said pointer to struct max77650_led - change the driver name to "max77650-led" - drop the last return value check and return the result of regmap_write() directly - change the labeling scheme to one consistent with other LED drivers ONKEY: - drop the key reporting helper and call the input functions directly from interrupt handlers - rename the rv local variable to error - drop parent device asignment Regulator: - drop the unnecessary init_data lookup from the driver code - drop unnecessary include Charger: - disable the charger on driver remove - change the power supply type to POWER_SUPPLY_TYPE_USB GPIO: - drop interrupt support until we have correct implementation of hierarchical irqs in gpiolib v2 -> v3: ========= General: - dropped regulator patches as they're already in Mark Brown's branch LED: - fix the compatible string in the DT binding example - use the max_brightness property - use a common prefix ("MAX77650_LED") for all defines in the driver MFD: - add the MODULE_DEVICE_TABLE() - add a sentinel to the of_device_id array - constify the pointers to irq names - use an enum instead of defines for interrupt indexes v3 -> v4: ========= GPIO: - as discussed with Linus Walleij: the gpio-controller is now part of the core mfd module (we don't spawn a sub-node anymore), the binding document for GPIO has been dropped, the GPIO properties have been defined in the binding document for the mfd core, the interrupt functionality has been reintroduced with the irq directly passed from the mfd part - due to the above changes the Reviewed-by tag from Linus was dropped v4 -> v5: ========= General: - add a patch documenting mfd_add_devices() MFD: - pass the regmap irq_chip irq domain to mfd over mfd_add_devices so that the hw interrupts from resources can be correctly mapped to virtual irqs - remove the enum listing cell indexes - extend Kconfig help - add a link to the programming manual - use REGMAP_IRQ_REG() for regmap interrupts (except for GPI which has is composed of two hw interrupts for rising and falling edge) - add error messages in probe - use PLATFORM_DEVID_NONE constant in devm_mfd_add_devices() - set irq_base to 0 in regmap_add_irq_chip() as other users to, it's only relevant if it's > 0 Charger: - use non-maxim specific property names for minimum input voltage and current limit - code shrink by using the enable/disable charger helpers everywhere - use more descriptive names for constants Onkey: - use EV_SW event type for slide mode LED: - remove stray " from Kconfig help v5 -> v6: ========= MFD: - remove stray spaces in the binding document - rename the example dt node - remove unnecessary interrupt-parent property from the bindings LED: - add a missing dependency on LEDS_CLASS to Kconfig Onkey: - use boolean for the slide button property Charger: - fix the property names in DT example - make constants even more readable v6 -> v7: ========= Charger: - rename the current limit property to current-limit-microamp Bartosz Golaszewski (11): dt-bindings: mfd: add DT bindings for max77650 dt-bindings: power: supply: add DT bindings for max77650 dt-bindings: leds: add DT bindings for max77650 dt-bindings: input: add DT bindings for max77650 mfd: core: document mfd_add_devices() mfd: max77650: new core mfd driver power: supply: max77650: add support for battery charger gpio: max77650: add GPIO support leds: max77650: add LEDs support input: max77650: add onkey support MAINTAINERS: add an entry for max77650 mfd driver .../bindings/input/max77650-onkey.txt | 26 ++ .../bindings/leds/leds-max77650.txt | 57 +++ .../devicetree/bindings/mfd/max77650.txt | 46 +++ .../power/supply/max77650-charger.txt | 27 ++ MAINTAINERS | 14 + drivers/gpio/Kconfig | 7 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-max77650.c | 190 +++++++++ drivers/input/misc/Kconfig | 9 + drivers/input/misc/Makefile | 1 + drivers/input/misc/max77650-onkey.c | 121 ++++++ drivers/leds/Kconfig | 6 + drivers/leds/Makefile | 1 + drivers/leds/leds-max77650.c | 147 +++++++ drivers/mfd/Kconfig | 14 + drivers/mfd/Makefile | 1 + drivers/mfd/max77650.c | 234 +++++++++++ drivers/mfd/mfd-core.c | 14 + drivers/power/supply/Kconfig | 7 + drivers/power/supply/Makefile | 1 + drivers/power/supply/max77650-charger.c | 367 ++++++++++++++++++ include/linux/mfd/max77650.h | 59 +++ 22 files changed, 1350 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/max77650-onkey.txt create mode 100644 Documentation/devicetree/bindings/leds/leds-max77650.txt create mode 100644 Documentation/devicetree/bindings/mfd/max77650.txt create mode 100644 Documentation/devicetree/bindings/power/supply/max77650-charger.txt create mode 100644 drivers/gpio/gpio-max77650.c create mode 100644 drivers/input/misc/max77650-onkey.c create mode 100644 drivers/leds/leds-max77650.c create mode 100644 drivers/mfd/max77650.c create mode 100644 drivers/power/supply/max77650-charger.c create mode 100644 include/linux/mfd/max77650.h