Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp769imj; Wed, 6 Feb 2019 22:47:29 -0800 (PST) X-Google-Smtp-Source: AHgI3IYZAinZ9lrzUp96y0EvpHvoZc24pjQutMjWI7cUqxXq51Ei+dmqIole5UymN4nIpHZ2pp8o X-Received: by 2002:a17:902:724a:: with SMTP id c10mr15233560pll.51.1549522048931; Wed, 06 Feb 2019 22:47:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549522048; cv=none; d=google.com; s=arc-20160816; b=P7tD61lJobzzCLIjsAR5zKu0298AccGQPv+mhe0IsOjU3mcSllu4P5M+ItG5AigEA7 wzWHdoxzZ7Q0RKKogWl1e8NhZX9jVDLDeqkzi2EOU0LAuKuoMXsIVjM9qltO9cdEb3D9 p1RxmC3PtTwMhdzYjcdLhHikfhZOIcfhwJuvKPS09fXXL3b1IQDNUzzc3FpJP2/5Fk0m WWb8eOQ0AtHMfGNVwK45Dufhfb2o7pdpoRZ6CwM8z/jDDfS1Oyl+gSUw7bBPuG+2JrqV FCpgj0xb1DxWffn3Wo1JNQuDvFbQe4aA0+a7HVp77fA9BmBANkZ012YXRMRBPVBLbgLk xAMg== 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; bh=s5AqVM5x832e++YcW0IAxAoc6b/BO2QnL9AX9IxbtVs=; b=tqF8yPtbS6qOx+BvjURhQm/tfR8K34E1nre/kn5rJJJANmCdyuSGjuQY8k9d0AhfaN qlr9ebTV2DN1oVYTCuQA4f0hLqaBBDy86x9r1I8waE3WPWgvakb7C8yXX/4pqsXHpQsk hJ6wDhD1KEAUOWAB6gfrW4mcXfl6My6UQeAtpEkMD6bE/tUWUzzXyrmvRgP2WtLzsdJy n5nLyzrW3WXVx0LxJhRKDwWhhjiY4neUB6jqQiVJbToRjnjruim/r3U+GOj2ZxPPuWWb rYrf6U7ui00Ex5evAYTc676OZtGoV7E4nPPge8UljLHarjNT12vAyQlBxsihBMrpQe32 xmmg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9si7520044pgv.123.2019.02.06.22.47.13; Wed, 06 Feb 2019 22:47:28 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727115AbfBGGq0 (ORCPT + 99 others); Thu, 7 Feb 2019 01:46:26 -0500 Received: from mirror2.csie.ntu.edu.tw ([140.112.30.76]:34026 "EHLO wens.csie.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726549AbfBGGpp (ORCPT ); Thu, 7 Feb 2019 01:45:45 -0500 Received: by wens.csie.org (Postfix, from userid 1000) id 96D3D5FA80; Thu, 7 Feb 2019 14:45:39 +0800 (CST) From: Chen-Yu Tsai To: Maxime Ripard , Rob Herring , Mark Rutland , Lee Jones , Sebastian Reichel Cc: Chen-Yu Tsai , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Quentin Schulz , Hans de Goede Subject: [RFT PATCH 0/9] ARM: sun8i: a83t: Enable USB OTG Date: Thu, 7 Feb 2019 14:45:26 +0800 Message-Id: <20190207064535.9226-1-wens@csie.org> X-Mailer: git-send-email 2.20.1 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 Hi everyone, This series enables USB OTG on the A83T boards. The AXP813/AXP818 PMICs used with the A83T have the same behavior as the AXP221 and AXP223, where if the N_VBUSEN pin is driven high, the VBUS sensing interrupts stop working. In the past Hans made a polling workaround in the USB PHY driver. In this series polling is added to the power supply driver. The power supply driver work was started by Quentin, and shared with me when I expressed interest in getting USB OTG to work some time ago. Neither of us got around to finishing it, until now that is. Patch 1 adds a new compatible string for the AXP813 VBUS power supply part. Patch 2 is a bit of cleanup work for the driver. Patch 3 allows disabling VBUS input current limiting on the AXP20x / AXP22x PMICs. While not strictly related to this series, I found it easier to just send everything together. This patch depends on the previous one. Patch 4 adds the VBUS status polling feature. This is enabled on AXP221 and all later PMICs. Patch 5 factors out code to read out the configured input current limit for the AXP20x and AXP22x PMICs. As the AXP813 uses different values, factoring out the code based on model will make the main function more readable. Patch 6 adds support for the AXP813 VBUS power supply. checkpatch.pl reports a few warnings for this patch: WARNING: Possible switch case/default not preceded by break or fallthrough comment #100: FILE: drivers/power/supply/axp20x_usb_power.c:306: + case 1500000: WARNING: Possible switch case/default not preceded by break or fallthrough comment #101: FILE: drivers/power/supply/axp20x_usb_power.c:307: + case 2000000: WARNING: Possible switch case/default not preceded by break or fallthrough comment #102: FILE: drivers/power/supply/axp20x_usb_power.c:308: + case 2500000: However they seem to be a false positive. The preceding line of the reported lines is a return statement, which is definitely not a fallthrough. Patch 7 adds an mfd cell for the newly supported VBUS power supply. Patch 8 adds a device node for the VBUS power supply to the common axp81x dtsi file. Patch 9 enables USB OTG on the Cubietruck Plus and Bananapi M3. Please have a look, and also test it on boards you have, and don't limit it to just the A83T ones. As mentioned above, the polling feature affects all boards that have an AXP221 or newer PMIC. I haven't removed the polling workaround from the USB PHY driver yet. That would be the next step after this series is merged, and preferrably a release has passed. Regards ChenYu Chen-Yu Tsai (5): dt-bindings: power: supply: axp20x_usb_power: add axp813 compatible power: supply: axp20x_usb_power: Fix typo in VBUS current limit macros power: supply: axp20x_usb_power: allow disabling input current limiting power: supply: axp20x_usb_power: use polling to detect vbus status change ARM: dts: sun8i: a83t: Enable USB OTG controller on some boards Quentin Schulz (4): power: supply: axp20x_usb_power: add function to get max current power: supply: axp20x_usb_power: add support for AXP813 mfd: axp20x: add USB power supply mfd cell to AXP813 ARM: dtsi: axp81x: add USB power supply node .../power/supply/axp20x_usb_power.txt | 1 + arch/arm/boot/dts/axp81x.dtsi | 4 + arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts | 12 ++ .../boot/dts/sun8i-a83t-cubietruck-plus.dts | 12 ++ drivers/mfd/axp20x.c | 11 ++ drivers/power/supply/axp20x_usb_power.c | 184 +++++++++++++++--- 6 files changed, 197 insertions(+), 27 deletions(-) -- 2.20.1