Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1959626pxb; Wed, 2 Feb 2022 17:07:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxEBkBN9l/hSsN1RFE1lQTcrsTZDYt3KyMnWZv4Aee0nAm9vQJcx9pWHTXnYnvYj1BbwBZy X-Received: by 2002:a17:906:cc54:: with SMTP id mm20mr26373019ejb.313.1643850465819; Wed, 02 Feb 2022 17:07:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643850465; cv=none; d=google.com; s=arc-20160816; b=Xnc8R2WIzIR0sb1VZDgpaBjG6hwVXdpsxjUHVIxqztcR8ruhwB0LOMAZDXwizTiCjT a16SBhl5Q6D+SjgTeZrPnHiMK7KbHOFvypizZIHhXIEA6srl0OsKcDm5/fSUxksaj4U3 Wf2J7TL/iBnFCT2vm7DqOJIA6bsQhl880KxY9Q1iU7eC/JgZn6NgG8D79Rqngv8ZgCwh ng3k1goTd/sZ54KIQHeLpGPsjPjiE8BvmpP/SzYHzgQ05N9r2E7M1VVPd1NzNFZ4NiLi A5JKUUpcn7YSqJkq6+iN0EqflLLeVJNaYhjFmmJfgpoDfCfV9BwWsW+Z91pEQfXRsPmM 2fJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=j5Y8ilTGveXraQd360AMKChOGsivYDofx2aDpvsAavc=; b=EkdXcNC0s4VHhFAwf9Odj/Sxo58Khs7Sdtjb80fxtiFTEEqPHHzpQG813qrn81/gKq 54g9cl3+KMvCRGl8/FH607uzQ/5FeCpyYAtKA+XDpb0bFhEzOPksGX/J/VyKGi14dH7f 7fm8U+4QVODVtE3qE8wF6k4ID1Ys6E/q2F3VYDbQ7cAi2IEjoWC3big4jOLCkHG8QiUu PdSqu2QCfev5ZlesOz5t9fhK9W74MP8yzxCam2kjxhiYX9DEKt1PqNmyaJoY56Yurq6P jhvru0eI180vRPZPwnQxYgKdTDduh5W8vrYucZUwejC6LMdgD0uyq1gfd3HHvxNfH3Rg +FXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm1 header.b="AIyzq/SY"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=nWF60lG9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb30si11390035ejc.109.2022.02.02.17.07.21; Wed, 02 Feb 2022 17:07:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sholland.org header.s=fm1 header.b="AIyzq/SY"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=nWF60lG9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347856AbiBBWTv (ORCPT + 99 others); Wed, 2 Feb 2022 17:19:51 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:45985 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347845AbiBBWTu (ORCPT ); Wed, 2 Feb 2022 17:19:50 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id DC7CB5C0186; Wed, 2 Feb 2022 17:19:49 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 02 Feb 2022 17:19:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm1; bh=j5Y8ilTGveXraQd360AMKChOGsivYDofx2aDpvsAavc=; b=AIyzq /SYCM+kfIlAcC5s9Nq+kYUc0csQd09IqyUAo6G4YaKILttS8Of7+HwTvXP9bu4CX KmON3zLZ0ZTPuq1mEdUEX93eZIcQE9i3NoKd2o+Ox0qVK9xz8+MuDU2PiovM9dIC MFq8K+9R6/0BdSiy6vlB0nT9gjpbteOLWX+ScZyJlq4t8zEX6vD7DNgLxDFM5+kN wkOJ7ConkZHeibLOE5taa46Dn8dbanJ5GQlRuJsh8Za0wJd+fmhPsgp9WgTMSHHj +lI8XWuTnXNTjyCSS/GF/Mb0V4X/m80GgTGfL+w4ou9P9gb/I4rtGIL2hHwIi5wJ HJsnN0sJn+oARo7vA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=j5Y8ilTGveXraQd360AMKChOGsivY Dofx2aDpvsAavc=; b=nWF60lG98jBd9F5MI3qbw2BojNgd/FTXo/pCQsQZq21uT qZZJNEzsWr3d42LWc+XTTiKERdHi/DlVEkne0iH1Ceqwk4e2772ko0uEXOVNcPUi 5LXOdSvw6ShBQumK/51ExVVPzn4jkRThX5SaAW+y0iE1u7NNXAI3p0mP+U2ZWHML cJOKL5Y+uyifgdnd28PUsjPjZX4exmYj8qEgR0eBTWKKvyuMdTHHAXiunnQRSWIy jBlqIGQwq4XHd6AZRdxFYuETRv9Jx3hz3XUYMIZjQjNC+Dhb4lDEV8G7yirV6ZzP sh9mEb0Edcyv1aR67bxWPgvCsRqYHiyEfmwU5vJtQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrgeehgdduiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgvlhcu jfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtffrrg htthgvrhhnpeeiteekhfehuddugfeltddufeejjeefgeevheekueffhffhjeekheeiffdt vedtveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 2 Feb 2022 17:19:48 -0500 (EST) From: Samuel Holland To: Heikki Krogerus , Guenter Roeck , Greg Kroah-Hartman , Rob Herring , devicetree@vger.kernel.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Samuel Holland Subject: [PATCH v2 0/4] usb: typec: WUSB3801 devicetree bindings and driver Date: Wed, 2 Feb 2022 16:19:43 -0600 Message-Id: <20220202221948.5690-1-samuel@sholland.org> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds bindings and a driver for the Willsemi WUSB3801. This chip's bindings use the standard USB Type-C connector bindings, but the driver does not use the TCPM library, so a refactoring patch is included to avoid duplicating some fwnode parsing code. Changes in v2: - Always put the return values from typec_find_* in a signed variable for error checking. - License the driver as GPL 2 only; probably best anyway as I used a lot of other drivers/usb/typec code as inspiration - Don't try to be clever; use `default` instead of `unreachable` - Free the IRQ before unregistering the partner/port Samuel Holland (4): dt-bindings: vendor-prefixes: Add willsemi dt-bindings: usb: Add WUSB3801 Type-C Port Controller usb: typec: Factor out non-PD fwnode properties usb: typec: Support the WUSB3801 port controller .../bindings/usb/willsemi,wusb3801.yaml | 75 +++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + drivers/usb/typec/Kconfig | 10 + drivers/usb/typec/Makefile | 1 + drivers/usb/typec/class.c | 52 ++ drivers/usb/typec/tcpm/tcpm.c | 32 +- drivers/usb/typec/wusb3801.c | 445 ++++++++++++++++++ include/linux/usb/typec.h | 3 + 8 files changed, 589 insertions(+), 31 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/willsemi,wusb3801.yaml create mode 100644 drivers/usb/typec/wusb3801.c -- 2.33.1