Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp813672yba; Fri, 3 May 2019 10:52:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJ/SccVAzTMipZiPUYlC8ElZW1t9NyS9eJnWMELGkXJZ+6Y+SYQ+a81120qtDBpOGV8xVg X-Received: by 2002:a17:902:f30b:: with SMTP id gb11mr12314894plb.109.1556905958832; Fri, 03 May 2019 10:52:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556905958; cv=none; d=google.com; s=arc-20160816; b=BArn/q49CjZ6b2PyjM6XyTKKL9MN0M0YghgcD1IpAuihmW3x6zeX/UJZYYNP+nDW+q 5a9osCz0/F2I4B5V7SDKYrEodAAu8LVDnIi7OvUIdazgmp/sZRvokVBEUxac/HynUZT2 6TfT2so/EJbceYHlGjr//g9G/Wun2x33FbQbOm99Puvgks9Y4er4LO6o66fOwKge946k Duc9mgMUdLUUE9JfAKfbhskJ5Yn1+uj22lEd2cSPD7Ls3c8Ih75uOtL2+cB8TMqXYiHG nJt4QWlWy+xVkIMEr/fWY7gCN0NYo2sgBnJLpz/B38VmXOKzayD22kLRDZtpbSkOmTdD WI6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=eTbUIhgZYyKpsDYDRp4MfMyEXJIR47VXE6EtVxEkJu0=; b=CbFS7AqFOYVnwevUtThIkxB19BGGxvBeuD3EeNztozFul34mRcSiPRCkyMXXXmVygR 1XO1emMNoj9SJdhob63SdeAIzjsBstB0hzdkKQqM9HQ4uHhuXuj4hYQvWeEtjfAocsDm Bx/hkGn2x8wAUeWZCbqkW/dL3HoTmChWv26fybsTUNxr+6Ys+B0XyH7BdCLCzdlgQd9K o0M3tgHTjC6LjOh5LOF1SRcqV9jhgRJmdFgmDkNXae7dK/kZmFNEuwpDGGmM3eRy6KUL Qx0joMShGazMCV/RywgoI4P1bwdIh8SWBPO+/gAkctadoUiXdED2DTopa71Bn1KrHjah z8Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="mkmHELI/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j9si3311560pgh.206.2019.05.03.10.52.23; Fri, 03 May 2019 10:52:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="mkmHELI/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728350AbfECRA5 (ORCPT + 99 others); Fri, 3 May 2019 13:00:57 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:43907 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727173AbfECRA5 (ORCPT ); Fri, 3 May 2019 13:00:57 -0400 Received: by mail-io1-f65.google.com with SMTP id v9so5753833iol.10; Fri, 03 May 2019 10:00:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eTbUIhgZYyKpsDYDRp4MfMyEXJIR47VXE6EtVxEkJu0=; b=mkmHELI/w4WO18UJsmI8W+qPs6MVtLJfL2UnMEYKjpOqQ9s+ZoSzUkhq8TMenx9fAd vtvZ+wFz8kufYakunf+udHAv7PqiblNiMutSwoabNQCLynS3SLMVSBDWNqBmUKHIA7aU BsVHatWsMPpg16Gra/EJCjqQUyPc9P3iYMzCwR6Imiwv8mOFLCu0KsjzxSA43BaXk80Z /mVwx3V1kB42IUbC8x2QMHddkyxEgNkUSZPIBrDCcshFHKODN3baYGtwqwj4XnuAeeOX jxywXScjmDY1tqPQOfWgYiH5zG2vzw+v2GobWcq+KYaRZ2PnxnScw7gjmmB1gdl8LQ1b OFzQ== 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=eTbUIhgZYyKpsDYDRp4MfMyEXJIR47VXE6EtVxEkJu0=; b=IIL/bzlojUHeQnronjGA4drThNndmWrDWhGBVaj9+NMtzT1X+haAKDe3bDf/VBcinp GY3tE1Bbu6N2LLZiPWDZCOkEldsHZ8nrMZjAngYEG3tjJC3XFvbKybt8ezlJBgema6RZ 1ORTm9Cw+a+sa4Ox/B9Yl1P/zCGFSF8piaGeDV1FpHhDsmVuG3RsZyk0TpzOUH04XBRL 9S1Eb5zVVGTYk+lqO32jHORKa0uFPD7cpWaIKVxhZVpW7mpEs2ThK0a37u38TlUB9btS /J9VCW82mJnDFiVP9u9r5kwfzpeTCPdwL27ACKTPB/jvMQYdT5JKNn56fSCrwFayEGns iEaQ== X-Gm-Message-State: APjAAAV9rh1WA8WgLdDbO1kkeNlPcKQIhApelbiSvaNPz+9Cj5Yq8n8y xDp+5r/Kfx19Rx1yUQ53XFKk8JcX X-Received: by 2002:a5d:9a18:: with SMTP id s24mr2662210iol.200.1556902855739; Fri, 03 May 2019 10:00:55 -0700 (PDT) Received: from localhost.localdomain (182-254-181-166.mobile.uscc.com. [166.181.254.182]) by smtp.gmail.com with ESMTPSA id n184sm1342588itc.28.2019.05.03.10.00.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 10:00:54 -0700 (PDT) From: Andrey Smirnov To: linux-pm@vger.kernel.org Cc: Andrey Smirnov , Chris Healy , Lucas Stach , Fabio Estevam , Guenter Roeck , Sebastian Reichel , Enric Balletbo Serra , linux-kernel@vger.kernel.org Subject: [PATCH v6 0/3] Driver for UCS1002 Date: Fri, 3 May 2019 12:00:39 -0500 Message-Id: <20190503170042.19334-1-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Everyone: This small series adds a driver for UCS1002 Programmable USB Port Power Controller with Charger Emulation. See [page] for product page and [datasheet] for device dataseet. Hopefully each individual patch is self explanatory. Note that this series is a revival of the upstreaming effort by Enric Balletbo Serra last version of which can be found at [original-effort] Feedback is welcome! Thanks, Andrey Smirnov Changes since [v5]: - Collected Reviewed-by for "power: supply: Add driver for Microchip UCS1002" from Guenter - Fixed Kconfig indentation issue Changes since [v4]: - Chagned "interrupts-extended" -> "interrupts" in DT bindings description - Collected Reviewed-by from Rob Changes since [v3]: - Added a check for negative values to ucs1002_set_usb_type() Changes since [v2]: - Fixed a bug pointed out by Lucas Changes since [v1]: - Moved IRQ trigger specification to DT - Fixed silent error paths in probe() - Dropped error message in ucs1002_set_max_current() - Fixed license mismatch - Changed the driver to configure the chip to BC1.2 CDP by default - Made other small fixes as per feedback for v1 [v5] https://lore.kernel.org/lkml/20190501033434.18548-1-andrew.smirnov@gmail.com [v4] https://lore.kernel.org/lkml/20190430064557.28469-1-andrew.smirnov@gmail.com [v3] https://lore.kernel.org/lkml/20190429195349.20335-1-andrew.smirnov@gmail.com [v2] https://lore.kernel.org/lkml/20190429054741.7286-1-andrew.smirnov@gmail.com [v1] https://lore.kernel.org/lkml/20190417084457.28747-1-andrew.smirnov@gmail.com/ [page] https://www.microchip.com/wwwproducts/en/UCS1002-2 [datasheet] https://ww1.microchip.com/downloads/en/DeviceDoc/UCS1002-2%20Data%20Sheet.pdf [original-effort] https://lore.kernel.org/lkml/1460705181-10493-1-git-send-email-enric.balletbo@collabora.com/ Andrey Smirnov (3): power: supply: core: Add POWER_SUPPLY_HEALTH_OVERCURRENT constant power: supply: Add driver for Microchip UCS1002 dt-bindings: power: supply: Add bindings for Microchip UCS1002 .../power/supply/microchip,ucs1002.txt | 27 + drivers/power/supply/Kconfig | 9 + drivers/power/supply/Makefile | 1 + drivers/power/supply/power_supply_sysfs.c | 2 +- drivers/power/supply/ucs1002_power.c | 646 ++++++++++++++++++ include/linux/power_supply.h | 1 + 6 files changed, 685 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/power/supply/microchip,ucs1002.txt create mode 100644 drivers/power/supply/ucs1002_power.c -- 2.21.0