From patchwork Tue Mar 30 20:54:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 12173707 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=-11.8 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 16303C433DB for ; Tue, 30 Mar 2021 20:59:27 +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 310BB6199A for ; Tue, 30 Mar 2021 20:59:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 310BB6199A 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=TftxPkmvHokshJZFZt21s8o+gXGkAxgt3EzepuPLORs=; b=S/CBbnDFhmIZLloNx1/Tuld25C dc7U28APjfMakEzuisCfTjklyY090lHKPkaMS0s1chRqDWifCmDiJBpWd5+4C3lmlLUJ1LvCQ3IbD pVa+wj9JxBMZa7RS9q1FzOsP9RYuhN81i07SGJXueaZacdWpo/bIXi/tag/tNI8rKkaIMRY7aItHy q2pQyajf/fZdJFqToPl1u0KaJ1k/s/BtOek7mO2D08VpE3uYghBxYNaokIClsj23IN4qlqiC7Y6CC tKAfNKGCq6h7o4zFhlQ8b2B5tHp5ZvHaRzbrGW3RHeXT5brC0Mt2c/XDjBgUXcu14mZKVUr7bgWAl MqKEdZ+g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lRLPh-004pz7-Eo; Tue, 30 Mar 2021 20:56:37 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lRLO5-004pHa-8O for linux-arm-kernel@lists.infradead.org; Tue, 30 Mar 2021 20:55:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1617137697; x=1648673697; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=WDeyWZ+/Bo0B6egkKV7o1Q2mWeGTUV4+RWIdJ6r1dLA=; b=XoVIPWHmIMpHdO6T+sEtxyuK5OCYlnAHfltulwBv2tEwxn/uJ0RZPMcZ 9qloXNHHycVHMRmhn2i6rMi316MLzrrU5Nh2f+rsY3NrH40iW7WwgKejz rZUQ1+cuhLyOcryZQAzzc/HqLPaK8B2dzT+buEkSuF7QIbOzBS15UZ3RL 585X1NI8kRqja/svukdvQtLLITnt/OqmY7LJjLg7CrMlnl/NM8ALK1IOR fAHqSbSZ7ZP//F0UhNq04kV0bIYrcoU4J52eZw4Fe1VjuSmG3vh4wUvwF rWuMw7AT3N+KHri2lz8jF95z7RRlm+i7WwTu1vV0obY3UR/xAONi9G4C8 g==; IronPort-SDR: ypNLkrgT2JTu/IBzsBFFkMdwgCybxrjMyyAV4nfPua5ujpGX/zMc9ZEqzP0rtpJJABKvvqplN9 DK9NwZNfcar4hhyQpcWWqkWuHMHyU/XmZDvRwVSuvQ7jfKQi1Mjoe7fGJeMUYqfqiNRbvEZXvk EqvfsX8Q8dlWLa8/v+ORt6usUxrWZWV+uW5/KdDeNPQq8Fu0UbTPB0xNqiw7mgnWwg+mL6yJqQ PimcXxMBVUDZfWX3TKyMZB2PAJn3MM/qt2HaON+3HareYzAenII+Nl55TkS/xreAwPaBL/ufWZ Y/I= X-IronPort-AV: E=Sophos;i="5.81,291,1610434800"; d="scan'208";a="111925320" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 30 Mar 2021 13:54:53 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 30 Mar 2021 13:54:52 -0700 Received: from cristi-P53.amer.actel.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Tue, 30 Mar 2021 13:54:50 -0700 From: To: , , , CC: , , , , Cristian Birsan Subject: [RFC PATCH v2 0/2] usb: typec: Add driver for Microchip sama7g5 tcpc Date: Tue, 30 Mar 2021 23:54:40 +0300 Message-ID: <20210330205442.981649-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-20210330_215458_762524_10A386AA X-CRM114-Status: GOOD ( 12.34 ) 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. Changes in v2: - fix DT bindings yamllint warnings/errors - fix compilation error reported by: kernel test robot 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 | 90 +++ drivers/usb/typec/tcpm/Kconfig | 8 + drivers/usb/typec/tcpm/Makefile | 1 + drivers/usb/typec/tcpm/sama7g5_tcpc.c | 610 ++++++++++++++++++ 4 files changed, 709 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/microchip,sama7g5-tcpc.yaml create mode 100644 drivers/usb/typec/tcpm/sama7g5_tcpc.c