Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3269410imw; Mon, 11 Jul 2022 05:33:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tBnqh4328aYpBoFp3g5Nh4WBvqGlEE3CTROtjxr2J2LYhRBfM41BSFw1RSoSEiNUTNmtpP X-Received: by 2002:a17:906:6a03:b0:726:c0e5:d58a with SMTP id qw3-20020a1709066a0300b00726c0e5d58amr18226980ejc.288.1657542815510; Mon, 11 Jul 2022 05:33:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657542815; cv=none; d=google.com; s=arc-20160816; b=A+iWs9H8/OI7QgEi/0HyaVc6qvl3MaJzs40LycUhakl+vIT91iJyv1K166r/5ACJ3E G8WwZ5QIWerjzCh4PXkX4byZVpIFGFfjBhmVoh9GJ64Bf4kOopVq1UYjcHDc/qj2K8Ok APibrNASPSKKqfKcx7YsFnN5NIBNrz0hJkFN76+BHrh5pH0GIfgMKL423czJ5ewX4/3H hq1cPil6uUghYI0PdllmH+7POxqE5NFmBMNatjhTWak57N4SSorfa4Rz/cwdssnsNLFI eRFCaTsjl7NLUGAzUNxUuvLK6ubY0W+YYxiQPS8/63sOIwtm/82t7H7gyKnLKotiXx57 Fgmw== 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; bh=IBdPZD/lgcjOqxf5WRf16r/XmqP10xUsJSLa25j+xfA=; b=Rrc77AJzqJ/yYgafMT8MgpRkM0PqnS5RYh+iaFSoKuL052clK+UmnxC/mHsZ5Ol57/ 7t+TwSGL5iph0DiviVF2IDRfBiTIu4Be3O/jw5ES7kNUUSfdZr9jUlkforykCqS6Eddj 3jrTPe3g+0HoGtsnEMBpH+S6xyaCWHJD5IZmRSsDPURLe5emg7rzdaJa1zhfH7Yzimfk TR+GQEG2M7gBJDICFX9awYbnegRIEGszXGyL8hIqW9xu38Hrws2MG6ZA/NlebMDb+gg4 bI0ecH9iaUx/mm28lhMLl3U/u2866OyxsXoiwHa2LYWK842NgpDjbv/jjncJ7uUziy9g IRMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b="sug/jlaK"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l22-20020a1709060e1600b006ff09d27800si8738394eji.536.2022.07.11.05.33.07; Mon, 11 Jul 2022 05:33:35 -0700 (PDT) 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=@foss.st.com header.s=selector1 header.b="sug/jlaK"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231374AbiGKMDF (ORCPT + 99 others); Mon, 11 Jul 2022 08:03:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230286AbiGKMCs (ORCPT ); Mon, 11 Jul 2022 08:02:48 -0400 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D967137FAF; Mon, 11 Jul 2022 05:02:47 -0700 (PDT) Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26B8N677001288; Mon, 11 Jul 2022 14:01:38 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=selector1; bh=IBdPZD/lgcjOqxf5WRf16r/XmqP10xUsJSLa25j+xfA=; b=sug/jlaKi7GXltDcvf9j/ft4Y91YwbYlgTiJHwiGXAkuSPiygAFxynDNrfy4HSYGJ/R5 lTwwSIzOCbpv8KuCRWMAAXD4gQcpibOXocZiPY94wciD8gQI4CtWtCbFf2+NmsvGNdmT XdIbyY5uH94OCec0CEirxjEYBq3IT8013fAm+iHyAVe5jaa36efQqTV4CffXmB2KrMfU D317cTdjF05B0G5q29iuR0LGnur/wQVJNWE90y5CRQ2G+h0bHQ6mWlhSrGMxqJuApQ7l 86+azoo/O8CKkjKZ7LN5VEX8IqKttWadO6koCgrtI5snh662hw3zsqxXPH2RYic9LM9L Vg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3h6xtak5vc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 11 Jul 2022 14:01:38 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0A24D100034; Mon, 11 Jul 2022 14:01:38 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 031B321ED2C; Mon, 11 Jul 2022 14:01:38 +0200 (CEST) Received: from localhost (10.75.127.50) by SHFDAG1NODE2.st.com (10.75.129.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.20; Mon, 11 Jul 2022 14:01:37 +0200 From: Fabrice Gasnier To: , , , CC: , , , , , , , Subject: [PATCH v2 0/4] usb: typec: ucsi: add support for stm32g0 Date: Mon, 11 Jul 2022 14:01:18 +0200 Message-ID: <20220711120122.25804-1-fabrice.gasnier@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.75.127.50] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) To SHFDAG1NODE2.st.com (10.75.129.70) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-11_17,2022-07-08_01,2022-06-22_01 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org STM32G0 provides an integrated USB Type-C and power delivery interface [1]. It can be programmed with a firmware [2] to act as a PPM. Currently it implements UCSI protocol over I2C interface. A GPIO is used as an interrupt line. This series adds a driver to support it, including: - dt-bindings documentation - optional STM32G0 firmware control and update, over a secondary I2C address - power management [1] https://wiki.st.com/stm32mcu/wiki/Introduction_to_USB_Power_Delivery_with_STM32 [2] https://github.com/STMicroelectronics/x-cube-ucsi Changes in v2: - Krzysztof's review comments on dt-bindings: update commit message, use ports, use unevaluatedProperties: false for usb-connector schema, define maxItems for power-domains, adopt generic node names, remove quotes. - Christophe's comments on driver: use kmalloc instead of kzalloc Use-after-free of buf: directly print the offset Fabrice Gasnier (4): dt-bindings: usb: typec: add bindings for stm32g0 controller usb: typec: ucsi: stm32g0: add support for stm32g0 i2c controller usb: typec: ucsi: stm32g0: add bootloader support usb: typec: ucsi: stm32g0: add support for power management .../bindings/usb/st,typec-stm32g0.yaml | 90 ++ drivers/usb/typec/ucsi/Kconfig | 10 + drivers/usb/typec/ucsi/Makefile | 1 + drivers/usb/typec/ucsi/ucsi_stm32g0.c | 777 ++++++++++++++++++ 4 files changed, 878 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/st,typec-stm32g0.yaml create mode 100644 drivers/usb/typec/ucsi/ucsi_stm32g0.c -- 2.25.1