From patchwork Wed Jan 18 07:09:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 4154 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2199398wrn; Tue, 17 Jan 2023 23:49:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXsG7FpaA/K5gnuw139wK+DCrq/J36O7YsH1rIL202DxSQSl0NyyI4amSAoWbi2SDmyweSkO X-Received: by 2002:a05:6402:1002:b0:49b:63ea:b5d8 with SMTP id c2-20020a056402100200b0049b63eab5d8mr6166429edu.4.1674028193332; Tue, 17 Jan 2023 23:49:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674028193; cv=none; d=google.com; s=arc-20160816; b=J5op7GcIxiV5YzbVOO2Eaq/TRkHT7Gb+K5fBsnlYmMF2+42s8efI7ImAKGPK6SmH1Y LheBkXvHb+uX82gz6t7ud5KMUxWQ6rsWyakk3FKR/tRrY4EaBt+EwbYOSgwVM5VMPRKk dpqm0dbduggYofk5Phq2EhY+Ur1DjuGDQoEf8XrX5Yz+ccGHZAwWHn1zdwVmHBYD/qwe PihGF4x4DDDjUShQoIVwSuxjkGU9nnUEUGn8ytUUsBRTz44HFg9ZazXBJD/nl5cFVqui NCAcoP2dlXkj4MSXUWclFvyHQiTvybbeS8/zFYApl2qPPP58OWSWEgxSlH6fw2nxlFY7 tLZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from:dkim-signature; bh=2lgj4RneNZy7/eLi0Ndco/t/yWP4AgM0h1cCtHXHKe8=; b=uTm5gho/oepUDbo2UQpRk57ksI+tMNCcyUEb4KRVTvlWNg1+a5Y2PAbmojDTLUi8M0 zlMm2qYwn/s1suIW542XrQ/P2u8foQEHow3hjjQ+MdWYg4V/Xdm7uLgRy+qA3aeJG08I UrE1/0AxNP9miJun/cqAzUC5e49KMOVGExTCuXNzAdEvQSJxGNwe9eEqurbnMEUlR7JB 3uEzBoHvy7jN0LLfBDOQy/pqHO2e8yqL5g7durFHjAwbNJquFwUyzHy92BG51SJfPlL5 GsXlfppefpdwlBDxQ+p+DxwBzS4FTWllqgdNkQxTby+v66lLTsCR9++fGX/YspyjY8Y8 /s4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hq+vZ0Ke; 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=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id du8-20020a17090772c800b007c0a7b0c5b0si12298688ejc.761.2023.01.17.23.49.29; Tue, 17 Jan 2023 23:49:53 -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=@linaro.org header.s=google header.b=Hq+vZ0Ke; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229913AbjARHpW (ORCPT + 99 others); Wed, 18 Jan 2023 02:45:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229799AbjARHon (ORCPT ); Wed, 18 Jan 2023 02:44:43 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1118A61D74 for ; Tue, 17 Jan 2023 23:09:32 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id x10so45477709edd.10 for ; Tue, 17 Jan 2023 23:09:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=2lgj4RneNZy7/eLi0Ndco/t/yWP4AgM0h1cCtHXHKe8=; b=Hq+vZ0KeEBW1ot4+tWZFEBQnkR8mkQzKWjMTohbokG39jAlmjaSNfTM6tzO+9r6P0b DPIGIxZEmTplzR55nn3r3GjT1RagIEJa2RL/pyZ7L+sxfEShf213uyWi5ZaVR8UBgi9g b4KWpWPS4ky71N08jcZQEwlVTUKfiSHZNyXKq7XyQGgDfr7Fq9o8DO2opO9vcXulLkQj wxO/KMN8420uLEXgce2LaQGM1kv+K5A+YorBPjRhUwnUdgt1AoYCACF9NBn/F1DTgdYX TvYP4e07XwhwkKp7LCn6FgLWtjXCk5zyC1MmOT49XuEqmMNtLK+m7sJJ1kJ4n+wCl5Ng +zjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2lgj4RneNZy7/eLi0Ndco/t/yWP4AgM0h1cCtHXHKe8=; b=4+yCztHxdo3Q48i7J9sy5lqyERCgpNdBs/hdvrgz7ui7TaFGVExsFN9oMtTEuVqIcS PrVVYzb3b5yJKcGJXnvp2zx5fiIIavMeXKTzLRlDz0JwvYB5W9wI+ObwEGMvEI5ZsX5C R3DST/N90czcEYqov1JeTMZqsb/WW0IvMa4nkKkZmktESqYxOhi4OhaFdsy1oqyDf7MT 8U433FMY7bkD02NSRU1cDq9h9lfE4xypWhAOmWUEvaXw87EBUgZR/yB34mwCoVdKOUc3 Cw9KVi08RNAeEG5CfCVRkVPrJKz2mTeKzjOCN87H3/ccF0+MhFyZqpgPPlAgJVmEYiEE hUrQ== X-Gm-Message-State: AFqh2krDgoKmQg4qVdnjlx7JDI/eedTfOXd6kp2pOOf12DwlE1BsmNeI hJFV+Wd0AxrTyrlHKem9moPyNA== X-Received: by 2002:a05:6402:5d4:b0:469:ee22:d97a with SMTP id n20-20020a05640205d400b00469ee22d97amr7081517edx.32.1674025770563; Tue, 17 Jan 2023 23:09:30 -0800 (PST) Received: from fedora.local (c-05d8225c.014-348-6c756e10.bbcust.telenor.se. [92.34.216.5]) by smtp.gmail.com with ESMTPSA id bt16-20020a0564020a5000b00482e0c55e2bsm13596984edb.93.2023.01.17.23.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jan 2023 23:09:30 -0800 (PST) From: Linus Walleij Subject: [PATCH v2 0/7] usb: fotg210: Various improvements Date: Wed, 18 Jan 2023 08:09:15 +0100 Message-Id: <20230103-gemini-fotg210-usb-v2-0-100388af9810@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIABybx2MC/32NQQ6CMBBFr0K6dkwpSMWV9zAspjiUSbQ1UyQaw t0tHMDl+z8vb1GJhCmpS7EooZkTx5DBHArVjxg8Ad8zK6NNpUtdgacnB4YhTt6UGt7JQXtC29j2 bHWDKosOE4ETDP24qU9ME8l2vIQG/uy1W5d55DRF+e7xudzWv525BA2DaazuXY11a64PDijxGMW rbl3XH8bzRVPOAAAA To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Fabian Vogt , Linus Walleij X-Mailer: b4 0.11.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754046416698043401?= X-GMAIL-MSGID: =?utf-8?q?1755345786971487712?= This is some gradual improvements to the FOTG210 dual-mode USB host/gadget driver. - Create stricter device tree bindings fixing some mistakes. We have at least FOTG200 and FOTG210 out there. A third variant named FUSB220 is probably related but has a separate driver in the vendor code trees. - Start to break out common code for remapping of memory and clock handling to begin with, move this to the core file. - Check that the block is in the right role before proceeding, don't abort registration but print a warning if it's not. - Assing some default speed and the OF node when the UDC starts. This is based on the similar pattern in the DW controllers. - Implement a proper VBUS session handler calling down to the hardware VBUS control handler in the Gemini variant. This makes everything work on my hardware. To: Greg Kroah-Hartman To: Rob Herring To: Krzysztof Kozlowski Cc: linux-usb@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Fabian Vogt Signed-off-by: Linus Walleij --- Changes in v2: - Changed a single word in the description heading on the DT bindings - Link to v1: https://lore.kernel.org/r/20230103-gemini-fotg210-usb-v1-0-f2670cb4a492@linaro.org --- Linus Walleij (7): dt-bindings: usb: Correct and extend FOTG210 schema usb: fotg210: List different variants usb: fotg210: Acquire memory resource in core usb: fotg210: Move clock handling to core usb: fotg210: Check role register in core usb: fotg210-udc: Assign of_node and speed on start usb: fotg210-udc: Implement VBUS session .../devicetree/bindings/usb/faraday,fotg210.yaml | 7 +- drivers/usb/fotg210/fotg210-core.c | 81 +++++++++++++++++++--- drivers/usb/fotg210/fotg210-hcd.c | 48 ++----------- drivers/usb/fotg210/fotg210-hcd.h | 1 + drivers/usb/fotg210/fotg210-udc.c | 68 ++++++++---------- drivers/usb/fotg210/fotg210-udc.h | 2 +- drivers/usb/fotg210/fotg210.h | 27 ++++++-- 7 files changed, 136 insertions(+), 98 deletions(-) --- base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2 change-id: 20230103-gemini-fotg210-usb-95a76798706a Best regards,