From patchwork Tue Jan 3 23:35:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 3526 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4869072wrt; Tue, 3 Jan 2023 15:36:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXu1RuEvEDVwuHhhGj4TbCq77yxIaY2OSDi+Y9IOX48xmThox3MJcg1AZnYWl9bDdzvS09Oi X-Received: by 2002:aa7:914e:0:b0:574:35fd:379e with SMTP id 14-20020aa7914e000000b0057435fd379emr46320430pfi.2.1672789017206; Tue, 03 Jan 2023 15:36:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672789017; cv=none; d=google.com; s=arc-20160816; b=G4OISBhsQ+DKXiIE4KBI7EBQYFUZSlysv5qcFJsxNuOKiDHCQFpCVHzKnPuF8NZlR+ U7m1oJTKC2MwDVf4+x6jd79qFIuiUxKalqqVNcdfhezqlS0Z9kjTTn4qmzbqfxlw0aU3 WzV5GUlnyW5jK/vSUNgd4kge1IotQ72VRnhKNQgeWj5o3Ktc7l8bmKHufct3WXxL8tT7 ztdg06+mGqvFRHG9Y/cv7fGZiu+QQhJqOKAV7sFQw/vg55Uw88DN2iqZ7XjfZB2a+o8X rs4+j0YMpDvYSwdlX7R+M8BTxQ2rl0oGZurI3+3bPyB1Vie4HFDv2QdqzjAw+PFDCKHT nggA== 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=P8v/Sj/X5KiOx/wkpfi7/cXq7ufsg9Eb2/gL5FeExVU=; b=cI8lV/E3wsbGIaSwYyC+1LD1BnIesJTQBx98D+ephpYyDa7c61qy5v1kiuXChro/M8 7+RgVVc7EWmTPoCpvnq+87Fv5zmlIqmLTZV6sgRIcBKjHgUhBu32vEKI/j5LUx+qGmJ3 o/iZ3HCWpO5bFBPPB45TJ2AArhLCI4xKQSRdKH/sWTJ23u2mxGyE/FoUm5yF/ffZ1f4D B42Pi5CCNcjZx8CkgnGg334KDJQxRchNWh6Xv0usoPrwt/3Hcp/hx/dsaflOLtceWZyB OqeTKm4XtetLhxRJXbKBFLZaIFO3bTM3OuMGM3Z4HbTYYO9RGypX0uhHwkL4erJ3uew1 2+lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lZo5X85d; 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 f21-20020aa782d5000000b00562b0b92756si31461654pfn.297.2023.01.03.15.36.45; Tue, 03 Jan 2023 15:36:57 -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=lZo5X85d; 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 S238075AbjACXf2 (ORCPT + 99 others); Tue, 3 Jan 2023 18:35:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237008AbjACXfZ (ORCPT ); Tue, 3 Jan 2023 18:35:25 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C53091659C for ; Tue, 3 Jan 2023 15:35:23 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id bp15so47948631lfb.13 for ; Tue, 03 Jan 2023 15:35:23 -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=P8v/Sj/X5KiOx/wkpfi7/cXq7ufsg9Eb2/gL5FeExVU=; b=lZo5X85dn9IoD9hH6dzyKS5qQsUttihsDJCwSHm+iUxjf6OAN8lkuRZ78nwrs51zep vy8MX3KNwgRz7mWHl5SVjeBIV6YOEwPX6zabIUJyEk7ImkRkgxqIxTZPI5TqpSdNmXRW RegrmN2f8aOcs8RDF55NG5FANhvR8dThgOTUiAX5rOtjdMhGBTgCXtYj8UGRZASB1mgA Wq7tpdiYyiUeDt4omgWuPBcrUvDQ9hxExY4fxCrY+Y0ICsrr1aLDCEiOf2tz6kEE2KD7 0bS/oznERD+4/6dhGP3GbAxUW2Idolx3cPN4l35FQXqmSap0lk3o5BS2PJorJQowRshP JWjg== 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=P8v/Sj/X5KiOx/wkpfi7/cXq7ufsg9Eb2/gL5FeExVU=; b=TR/D8M/eFJg2ESdj1u6ggWeYw8vMBbtknBBhhPt26Op/q/90D2gxsTLIs30URkJDUw 3lfUd34gTCOSjIuIck0Q7LgNeVZNTAvqBYRo6d2YzVpATC9lYvzotn5+C/DhF3fCnWBF HZMakFsO5r0Uag90I3wMX1xO98vjait5Oie3lOleTnR290zMGO5hSflM3Petn9HuGTxc A2RF6z+fB3CU6v+hq5q7UuCQOiv5hq/o0Pqug41ibyHOtrKjQDzXGR//Y5FODbLYu8UD 0x7rE1dq5klDH4WFmHVE5v8d88HMmgn9NbM/NDiTZjw70XQebaVJFzGRA1GqcBjRgWRW vC9g== X-Gm-Message-State: AFqh2kpZbyt2rckvBjpt+u2IeVJX3suR0Im5/6Bx1Ar3DhyZyA9BDRco OdKkCbzerRR/MgejYQEcqnCKlw== X-Received: by 2002:a05:6512:2344:b0:4cb:90d:41b1 with SMTP id p4-20020a056512234400b004cb090d41b1mr9099547lfu.56.1672788922157; Tue, 03 Jan 2023 15:35:22 -0800 (PST) Received: from Fecusia.local (c-05d8225c.014-348-6c756e10.bbcust.telenor.se. [92.34.216.5]) by smtp.gmail.com with ESMTPSA id b11-20020a056512070b00b004a45edc1de2sm4939801lfs.239.2023.01.03.15.35.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jan 2023 15:35:20 -0800 (PST) From: Linus Walleij Subject: [PATCH 0/7] usb: fotg210: Various improvements Date: Wed, 04 Jan 2023 00:35:17 +0100 Message-Id: <20230103-gemini-fotg210-usb-v1-0-f2670cb4a492@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIALW7tGMC/x2NQQqDMBAAvyJ77kISqan9SulhY9e4B2PZ1VIQ/ 97Y4zAMs4OxChvcmx2UP2KylAr+0sAwUcmM8qoMwYXWeddi5lmK4LisOXiHmyXsrxS72N+i6whq mMgYk1IZpjOdyVbWU7yVR/n+b4/ncfwAMEvlbX0AAAA= 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?1754046416698043401?= 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 --- 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,