From patchwork Mon Mar 29 21:33:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 12171335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D51C7C433C1 for ; Tue, 30 Mar 2021 01:01:37 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 518D461988 for ; Tue, 30 Mar 2021 01:01:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 518D461988 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=+klzRv0VhhFSQlv9TltOi9SzNQOPHyx8nNSYleT9UEk=; b=HN4PPtQ1Rd4QfBTRsCeq4ZofAL fCj8xGcuW6i/vba/rigI9YvbUWwcENO+wES1rpAzCQtu+ChUsCJ9tjvNDU8oSUpnR9INPT2dFcBOB jYooFAYC+ey+D9BxE0REe3hFEsAbVdsWsAcMMP1qBLFDfy3esrWzydGf/RLCBLZWej4R0rTgCjyH9 LK2EMjRR6msbGXO2cIbtcirmEldaE/Incsl3uLcjlippFVNdG092GyV9k3iFAM+zSPwPyxHTeO3FX 1f//q930k6vCmSSHqGcvI1QodyjBM8H8BTkgRPAobJ1vAeb61TGpMAtMST4YBNIbFinfdeN2oNZ+r ggnvNJTw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lR2jD-002Hmf-Nu; Tue, 30 Mar 2021 00:59:32 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lQzWi-001Tsr-2E for linux-arm-kernel@lists.infradead.org; Mon, 29 Mar 2021 21:34:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1617053663; x=1648589663; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=2kTOQKtN0t9m6S1C1pzGz3PzM5EesinMEa6hjWzfgDY=; b=i/tLDd3JsEDGm1KfWkzZSYdUWH1+exwdKxbuMs70UjU/uo1fDk+pWpRY 8gKq5Ndx8bQYX2V32mJA4gOq96vd9u+VYEMucpMGxzWuFsU2jlWMlQ5mW xpbMtIIDdpnpVE/0hXwt5hQV8ckaX+xe9cFUwLRQWDQzzFBOXAUkFbkM0 e9RJ3D5J1/t6zsdqlPqQ/KIt24MR5ZlQkhQMzAr5ws76KDKNOawO/12gt NDrTletDQ0+wuOFIxB8ACWdN98QtUXMfTxs3i/LRVZoN0cog+oqPHSha0 /WKx/dtn3mNtnoRot7f9JTT/vUN6crOpSNZxCtDMqSji9AWbzpWF8noo0 g==; IronPort-SDR: UCF/K/3Bzx1tQnCR0a0OpheQyJ5HyNk4EBJkUnwMqtphT9lMSwdNvYB8BjLv1ZWU1tTjM+jcif SkwiJiMWowts4FeIxJV/J+32skB0dbG4tDkHAT6lg68sZp/8jjly8OMry3/G6RAFJ4k9CbIr5i ynPvtFSKl3g7fvf+Reu0OEeK4q/XaFRGmlOWMTA0k1nm24J6aN7Xrqy0Kq/jAxBdf4+lx5dlsC bchp3ssUON9u+wcM4hq+IXMJOmtgwppbyEbI7UZ6OKvvWfQGaaWMI/ktCjY3S5eSUVQHeSF5BC VcQ= X-IronPort-AV: E=Sophos;i="5.81,288,1610434800"; d="scan'208";a="115079626" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 29 Mar 2021 14:34:18 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 29 Mar 2021 14:34:17 -0700 Received: from cristi-P53.amer.actel.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 29 Mar 2021 14:34:15 -0700 From: To: , , , CC: , , , , Cristian Birsan Subject: [RFC PATCH 0/2] usb: typec: Add driver for Microchip sama7g5 tcpc Date: Tue, 30 Mar 2021 00:33:55 +0300 Message-ID: <20210329213357.431083-1-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210329_223424_687372_3D7A0A26 X-CRM114-Status: GOOD ( 11.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Cristian Birsan This patch set adds initial driver support for Microchip USB Type-C Port Controller (TCPC) embedded in sama7g5 SoC. The controller does not implement power delivery and the driver uses dummy functions to register the port with TCPM. The current silicon version is not able to trigger interrupts so the driver will poll for changes on CC1/CC2 lines. Support for sink is implemented and tested with an USB device. The plan is to extend the driver and add source support. Cristian Birsan (2): dt-bindings: usb: Add DT bindings for Microchip sama7g5 tcpc usb: typec: sama7g5_tcpc: add driver for Microchip sama7g5 tcpc .../bindings/usb/microchip,sama7g5-tcpc.yaml | 80 +++ drivers/usb/typec/tcpm/Kconfig | 8 + drivers/usb/typec/tcpm/Makefile | 1 + drivers/usb/typec/tcpm/sama7g5_tcpc.c | 602 ++++++++++++++++++ 4 files changed, 691 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/microchip,sama7g5-tcpc.yaml create mode 100644 drivers/usb/typec/tcpm/sama7g5_tcpc.c