From patchwork Sun Oct 2 06:45:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 2413 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id F2F2540F4C for ; Sun, 2 Oct 2022 08:45:46 +0200 (CEST) Received: by mail-ed1-f70.google.com with SMTP id y1-20020a056402358100b00451b144e23esf6570095edc.18 for ; Sat, 01 Oct 2022 23:45:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664693146; cv=pass; d=google.com; s=arc-20160816; b=OXvB1dIKL9jR01en2w2ssc16WZzrOaHCFkdNhF99TJS+Z2/Lv69PLnM8q/sxhxfPQy NYOOh1fJW+922PhRbiiMdAQf3coApJKFAZJPNqrOEpx1yH8IO99znFylQSmddxD0MpMj Lte+sud2aNgxrx+qXZUxw+a57XON6iV67zFhnW6nidEdZAL1mjSAe4IqeU46TgjPvzRz HQtUMxBccZf6nkxojrMGr6O9T1ro6+wNFMIZ51aFGkttits9HhPoSulcQuipodWI07Nx ZeOJKCh8v7ughN4GxPElPeXcGGAzxHppkcoZ//41B+GnZL09+X6r8MepoRYy5zDsQg0i 1lxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=KOquWw85uEWjAMJL8hA89IZ1CqSRzEV6JBdYAJslzBA=; b=wknw0rsTfBUvea4RT+HVPkIX9wykPtBLmpze73GijsJhVLhW806+YqBmHEm9SafOeH wkbdq8lB443dPbGmvLKhxujXvD3qk0a+XCqqdvCaLSlU/l6RmRWX9kPFatr21Ofsl7Pl eeHwvGnDVZOLAZu4ZPy/9ErQ4JaaiJ0fj3UeoxlZMgc7Y24pmiRihpP7EWakmBb6IhrR 3ZtY2ekWQkTek/YsoeBAfFn5LLcSmFCoC3cLBuzSz+H613jsA/0nmLUbjwzmgbAhIk+Q Ok2eFs4JHS25cnhI9N/UqSy6rvXtCOpb2XvfX5ajzImJFt2V6eeAb1alIlTBpyj/70GZ LHjA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Z6eZABtX; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date; bh=KOquWw85uEWjAMJL8hA89IZ1CqSRzEV6JBdYAJslzBA=; b=cn/wmE/ZQojyz1DmPsdYS08IjPAdYrCzl39iQYi3Lio1d+0GZuWG79Q+c46jSt0r+n LJEx2mKvoRvuv/5RrFVBmi83Z3aJKBXW/E4Mo3I0uHjpAi+N56gHGMkRYvICMq/XbRFd ozLzgdIvL/LuyaKsDsETt8Us1D1wrSeKlgr5s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=KOquWw85uEWjAMJL8hA89IZ1CqSRzEV6JBdYAJslzBA=; b=L4Tbnz2osoZk8CkGZybUNUTyQhFEhOJ14Lc3thsVpLVczIZ68WQ10qo69kpV94hQkj Ei7seoxPecHVVwqkOUnzs+eSPZbhorhmcURwyftkhsmnwVycS1gk6kqlm2upQanl15e6 wmefF0stkq0rOpZsE/2ELRTzZ0YIb9Sy+cIFqCvuTpCew2VRO4FIkws4QIZOYQs8MqsJ fXaR9Pmc/KrbOrHof6D/3gdr5qSjmHujOqpU761lBLe5cKZdvrJkebDVAmJ7D6slZNR4 ESDJTTo3rNwg/0fE8a42n2sVBOlxWR08LA7Jugv4CndQ18URGJu7Dvpt3qKfNa0nzKKJ yhoQ== X-Gm-Message-State: ACrzQf1ZwKOOvnADOhM4Hez4ZoUkdQG7D9KLM1iH7uw2//D67xngqNpY nVFcrCVpnOUsb4e22BMbkZC0Mo4M X-Google-Smtp-Source: AMsMyM51gYmRiqSIGPuIj6eXK70Mvj9sJ9srXF05koCvPlYqaHetiggPO5r+OGVPs9F5XJh2cO+DnQ== X-Received: by 2002:a05:6402:5507:b0:452:183f:16d1 with SMTP id fi7-20020a056402550700b00452183f16d1mr14254473edb.96.1664693146742; Sat, 01 Oct 2022 23:45:46 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:907:768c:b0:73d:afe3:ffd9 with SMTP id jv12-20020a170907768c00b0073dafe3ffd9ls4000096ejc.10.-pod-prod-gmail; Sat, 01 Oct 2022 23:45:45 -0700 (PDT) X-Received: by 2002:a17:907:2cf0:b0:787:e52b:c21d with SMTP id hz16-20020a1709072cf000b00787e52bc21dmr9949994ejc.262.1664693145325; Sat, 01 Oct 2022 23:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664693145; cv=none; d=google.com; s=arc-20160816; b=DcHVPn00oYzKSPJaPTbx03PV3IHxmPUBthT9yvZSRZdkvReLDaitFMsJ6BlzLRIH5k C3ZvFVcHrNgpns5U54qojPTPMOw/LGSDP2etDP2H/BwEpWsTtIgcs13fohCVqHfTp09a yPFBe8JT03/5aDdlWOJyuL+pfwhNvrWDz07H9F2Zi/DoKEQA3/YmF6rErFgqFmAAxGcp kcsTH78DKR52DZ6Y8b/kjhNigypJSJtcDTMeWdz+0XHi0xe0/psEf5EIkTnm+UyDtRv3 ABCgxD6hVlql2x9GPC/urLCfTrkWe3+C9tEBHkIYPZ9+FOChuwSgwCCZUpMxngmdofHq wlyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=+EFb6uk4cTnqBeI+5KKFVfi8qmpv//hil6I+XjIEg10=; b=ZNhzrQYhdDYXi48qBTJSi678JhlRxcCFQepJoHoV4A+DwFEBvSRdCoDMlUDBV7rQyg K4QVgBxFCcf1Y16z083UZ7VUz6wXiHmDplaQl568rMNUMb6p4mVxhbmYzKvhgPjtH0Hu 21saLqOkZhkQ2iIF2tsthNpZeybuOxXj+0B+/bjcrwUriUffH3NYIKgZu+zEteOPt/W7 X4jvHatlxQaD2zcL/6YBSwHr36jycVaIackGm5+76pmNZ0AJ8UnyvviDWcoQSiUkxBCs 1rTZsX+VE7mJntocj8FFbJTB/drTi1Z0P5cHTcDqZ8hn+rH0c8cASYAv74hlqqPQxyyW pyLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Z6eZABtX; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id q9-20020a1709066b0900b007814f0e2347sor2202515ejr.76.2022.10.01.23.45.45 for (Google Transport Security); Sat, 01 Oct 2022 23:45:45 -0700 (PDT) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:907:160d:b0:782:bc5d:162e with SMTP id hb13-20020a170907160d00b00782bc5d162emr11502660ejc.291.1664693145088; Sat, 01 Oct 2022 23:45:45 -0700 (PDT) Received: from panicking.. ([109.52.206.103]) by smtp.gmail.com with ESMTPSA id 26-20020a170906329a00b0077f5e96129fsm3569894ejw.158.2022.10.01.23.45.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Oct 2022 23:45:44 -0700 (PDT) From: Michael Trimarchi To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , David Airlie , Daniel Vetter Cc: Kishon Vijay Abraham I , Vinod Koul , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-amarula@amarulasolutions.com Subject: [RFC PATCH 1/4] phy: add PHY_MODE_TTL Date: Sun, 2 Oct 2022 08:45:37 +0200 Message-Id: <20221002064540.2500257-2-michael@amarulasolutions.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221002064540.2500257-1-michael@amarulasolutions.com> References: <20221002064540.2500257-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Z6eZABtX; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , There are combo phys out there that can be switched between doing dsi, lvds, and ttl. So add a mode definition for it. Signed-off-by: Michael Trimarchi --- include/linux/phy/phy.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index b1413757fcc3..87ae8c27ec57 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -42,7 +42,8 @@ enum phy_mode { PHY_MODE_MIPI_DPHY, PHY_MODE_SATA, PHY_MODE_LVDS, - PHY_MODE_DP + PHY_MODE_DP, + PHY_MODE_TTL }; enum phy_media { From patchwork Sun Oct 2 06:45:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 2414 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 021443F331 for ; Sun, 2 Oct 2022 08:45:49 +0200 (CEST) Received: by mail-ed1-f69.google.com with SMTP id h11-20020a05640250cb00b004580ee86ca8sf6498614edb.6 for ; Sat, 01 Oct 2022 23:45:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664693148; cv=pass; d=google.com; s=arc-20160816; b=P0Ch/OF1tEAmaD8ges6qaP2QKG2Bz5AiSgmF5M7RATm3E8ConrUKVAcccH9FZb04tM QSozXFWF66iTlt16fqrPPulzsowAsF7nO90BdsFqCOUP9d9ThErg13K3vlyvt37v4v0m c+Hpn2MA0uiVZrZt3SwIeVhVyjbIB98X0/Gkz1C7x2JkBbcQOood6fMn9U+CdId0zT9+ mM6yF7TtLEZxv/smxk11s3Y4MYrpdwapULsy8hVSH3pfWF1Yn6Qt0pkt6jPn9IT1q3Jo f/MtIDZ3w4Xcm97mo8s965iJV2X3U+QwHYZnwTMZrNmgnndu7EeH78GFO33wskGBjn4j K+gA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=L918xq5l0e9jk4pn3xAJkMNJBkit0KUb1jSXi2POoqU=; b=dr+ddBgylraeohTsvTQUMG6YBixIkzDADMjsDVeKRLy/UEFPxkZctfnIesbiTsCdab KwUsh4edM1s6zJhBJxKLWGXfPLehI3959aErmHTJCnOLHvyPKxXX1tPPIFuqImBfvaid vS25GoZlFB+u/z9ve5srB/wlzJVmi0arhljgJ/kTbD9CcbmJflKLDg4XlLmsuEWBwlZr VaapqS3tBXkU0jFareAvab834g6ruJrL3JqzzDLa9suE6eq9ZdXdrnLon5ghkb4vkMHj bYCPLjVPj5mfV7hLG6ljAxXT2cJpllVmg9hXbcCDUmtN0wLhYfKy0p5kF1Awt1e+LakS kDrA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kdPlUwAL; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date; bh=L918xq5l0e9jk4pn3xAJkMNJBkit0KUb1jSXi2POoqU=; b=h/oyohvS4cHxg4cYQphyEpv5WFJh+3v2glO+obPgeNtvu3yxSAIE/uWgGmhbxlGYEM 7zaf/UHeiy928QYtFYMSuhKkSYjlymhwlQ24m1l1/E2wFrg8QiV7Mggnha/zevQCnFup 5078mgudVrZ1suC2uvcnyPQmdcruCzcMRMRqg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=L918xq5l0e9jk4pn3xAJkMNJBkit0KUb1jSXi2POoqU=; b=cJmc9EPj/vbCvRoRFjE4OnApAks/mSEGL4wGN96DB4jgaGsu+cblJssbsJ0YJgzwIP 0Hk/jgnfg2HA6eg7uCK/NfVhgapcm+jPl7AoFII7xzfGpuCyE/FdNi8WxS/8+lr95RQq uSF99IdYpH5FB7woZlRqEM/g4LB58jGb5nBTrGvwdpodP2bc2Ltu+rSJbEPdlRrscQp1 efJ2C0Q7LgbOm+NI1cbvTy3/cuvWSBveq3DWBE2kXGYUkmc3siGyBfOEeoKC0kDF8r4u oob1YpoHW1AZlmHSOf8yUl5cXY3SR/vP7iTVzVeqXqg68TsTiK43TCHeqFElH0Q9uWxZ NfEg== X-Gm-Message-State: ACrzQf2UIzpmxwh+Zgcb4GKfGvZbjCg6ZKETx0whzk+Fl2it200VKbRE DACPnObsxvVLRlY5GWPyJj4wrhud X-Google-Smtp-Source: AMsMyM7APQcUOSNzdBZgJdQHUT1+zE+VcDV6QOKTZIlvbwqHu8R3G1uskDCAXCDEj2WQ3LKUdpAF6A== X-Received: by 2002:a05:6402:11d4:b0:452:a97c:cd36 with SMTP id j20-20020a05640211d400b00452a97ccd36mr13988645edw.53.1664693148694; Sat, 01 Oct 2022 23:45:48 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:42d0:b0:457:99eb:cba9 with SMTP id i16-20020a05640242d000b0045799ebcba9ls7951733edc.0.-pod-prod-gmail; Sat, 01 Oct 2022 23:45:47 -0700 (PDT) X-Received: by 2002:a05:6402:74a:b0:458:cfe2:f351 with SMTP id p10-20020a056402074a00b00458cfe2f351mr2954131edy.359.1664693147306; Sat, 01 Oct 2022 23:45:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664693147; cv=none; d=google.com; s=arc-20160816; b=fAG7RBNertg3JHe8fAM4T4Fe9h4Eb4RuQyrCd4n2BIqXyHT2TZdebB5qukWzedoh14 TxKsQeXlpBcMt1DLmWbOwCuhEHU1ehT4P4HEsAqH5hMde05U6ovMjfgahOdOo8btvIbo Z9z7TorzWWvG8R90lL/m8rNYL5o6ZnE4eQUslftDNaP71PcWGV1ak9978p5PdTdcVLDL bT47cdJW2dIG6RakfjpQTTnYq5vbYsYOnOB9mYiorQr5cQS+Kq9qU7udod572K3K42MT wUqVgrr79Fj137nCdYtjertER/+Nc3cVebBtNXGkyBUKuwf6ZkZJaZbVbsLQn4aj/0Ce Odfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=I6XMIDzmAb5OEYRQrNrBJ64J1RkMPb1xdg1o6LLrqS4=; b=cPCpEQVmtSCIK8//4R/oM3sWUjTprKEKUoF45c80zlrHQ1rte0KwyJVNFegVeNbLIo raqsGzZ5PTujvxhmAhjB/IASFYg+soShqUPah4s9aXcpuD5a9vtbi0TQvs0CHBCbaQ40 VgfjXfvw8Y5+jtupXxGLTP4uFcSh4L8U3RDZPsuEFCTJK582CNxjCeaxJsTXPED7J9A4 ZmXR1pM0EK2TYtK+S1pTDcMsT/u04UE9WjKDjs222xCRl8O9sG5C8WCG4fPBkIzz/CYA FUMZRLjwzJEryvboDeB5ZPNG8O/qvRH/4vaXc0/LEEznVwZm3u8iJd8WktbJWiPnODo/ yCTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kdPlUwAL; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id b13-20020a1709065e4d00b0077d1233d59csor2183126eju.49.2022.10.01.23.45.47 for (Google Transport Security); Sat, 01 Oct 2022 23:45:47 -0700 (PDT) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:907:2c67:b0:77d:740a:e9b1 with SMTP id ib7-20020a1709072c6700b0077d740ae9b1mr11198850ejc.614.1664693146999; Sat, 01 Oct 2022 23:45:46 -0700 (PDT) Received: from panicking.. ([109.52.206.103]) by smtp.gmail.com with ESMTPSA id 26-20020a170906329a00b0077f5e96129fsm3569894ejw.158.2022.10.01.23.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Oct 2022 23:45:46 -0700 (PDT) From: Michael Trimarchi To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , David Airlie , Daniel Vetter Cc: Kishon Vijay Abraham I , Vinod Koul , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-amarula@amarulasolutions.com Subject: [RFC PATCH 2/4] phy: rockchip: Add inno_is_valid_phy_mode Date: Sun, 2 Oct 2022 08:45:38 +0200 Message-Id: <20221002064540.2500257-3-michael@amarulasolutions.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221002064540.2500257-1-michael@amarulasolutions.com> References: <20221002064540.2500257-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kdPlUwAL; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The function is used to avoid to enable clock on the hardware if the mode requested is invalid Signed-off-by: Michael Trimarchi --- .../phy/rockchip/phy-rockchip-inno-dsidphy.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c index 630e01b5c19b..644cf73cfd53 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c @@ -217,6 +217,20 @@ static void phy_update_bits(struct inno_dsidphy *inno, writel(tmp, inno->phy_base + reg); } +static int inno_is_valid_phy_mode(struct inno_dsidphy *inno) +{ + switch (inno->mode) { + case PHY_MODE_MIPI_DPHY: + break; + case PHY_MODE_LVDS: + break; + default: + return -EINVAL; + } + + return 0; +}; + static unsigned long inno_dsidphy_pll_calc_rate(struct inno_dsidphy *inno, unsigned long rate) { @@ -495,6 +509,11 @@ static void inno_dsidphy_lvds_mode_enable(struct inno_dsidphy *inno) static int inno_dsidphy_power_on(struct phy *phy) { struct inno_dsidphy *inno = phy_get_drvdata(phy); + int ret = 0; + + ret = inno_is_valid_phy_mode(inno); + if (ret) + return ret; clk_prepare_enable(inno->pclk_phy); clk_prepare_enable(inno->ref_clk); From patchwork Sun Oct 2 06:45:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 2415 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id AB3C43F331 for ; Sun, 2 Oct 2022 08:45:50 +0200 (CEST) Received: by mail-ed1-f71.google.com with SMTP id v11-20020a056402348b00b004516e0b7eedsf6616098edc.8 for ; Sat, 01 Oct 2022 23:45:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664693150; cv=pass; d=google.com; s=arc-20160816; b=ExrROLfrefNHha/YSyvaTmrxPZzNSCgVNmlfdpnTN7GV6DgPY+9p39BPoZKKtWM63w 1dAmmn6SjjE2ZxgjC5657zPsU82yLTdeIdlthZZZga8vGWfEZAOeuQwdinEjHL/7ft3J ykjxl+gll+gdW1Nw2Ofm/jlNgJ4XVuQF6QTeODWoDQUV4+v6OFQwWRQsviYQE5WfSZrv G/OzT7fqI80UDjCBbW6rIFLseycAQlcVaPUuK6RixTJUxoqm5TnmtMhirpagiVpBQzwN hTIuJvHQTzMqkssj2wEiP5WTNIx4wyUFXu01pIIKayhgivpo7iVVpjb1LABz2uA+aNzg x/iQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=fXuWLDSM1rcnB4IVRVDn58cYyBfVnseOZVpWw1GaH/A=; b=OhXll0XvrhZ9sdyW8RGBcSTQo0Nqc3cS99oFUXPsZp+SOQBixOSbsQLzz2DWmRI0Wv /NRpibiCMyFlMfsi0JYCtXW6SibXGgz2dPgZ9isewRkH/wTkc79RxfJPUvwyz6YNgB7Z beXmQ/6dXLPJPM4LA+ukjYloLqysJdrPQeh17bhHRui5e4hu9P968H64NcZ28qbQWQrC Q/lz9C3p6zZjkO4E5DNNkJSpTfb4DLDom4BHBMqqjNljjv6iwJa6npIlTGLAmpTmxiH+ QwIi87yPgHEhd2O2KoKEOlYpcFJPEPPeAXtDOqEF1txf8pVHZY/U1w/lDgt8AyHEUl6x DzvA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rsLBLijZ; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date; bh=fXuWLDSM1rcnB4IVRVDn58cYyBfVnseOZVpWw1GaH/A=; b=A6mLIJY6xTXmwd7hKR+Va2JxQBtWIFLDJquMTGjbukprdvS0F+hStKTYMyro4MVuFR h2ihi27MKPfYFslCv1jwEPdE3CShDOOw4mHE66lIjsYQXQVIqdFIXtRTpVuY6Tpv1aEO bAe806gnAsvKHzvSH+J9OqvKND+7cBR+NoMms= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=fXuWLDSM1rcnB4IVRVDn58cYyBfVnseOZVpWw1GaH/A=; b=5XT3LO7ASbJGKtm/X+JsHml8j+AWKm7TMx/87B+tSrPquBTEuZazmOQ3eUw18iYcgB Yu+7QesgLYcsYyZa/aPcyvyUoJmA235PvBzx1VYxu4Kgjmtq1QvpBtt7vDLGibsD088L wiWCu2gaBJna5XfXOhLkbKVje2KjngCJi4r2NjqFRN+iG12p6Lpvgc3V/RCYa+uNTf6d ms23YkxAPZb9EaStZrGPm+vwExOgNZLYGz3V4swwWsaYBGIx//4GQ/Vfy/vewpKSF/G8 i2cw85eP6dkM4hLRRYsC8Q6M975OBdswFu6AryQvnGx5WFquRqmX3MsjxDTO6su4aryD +r/g== X-Gm-Message-State: ACrzQf3k92DJO9G42CgiETujqr6JrqZtfp5J7FLJHSDh9+EUOTL+ihXP 36KkbgMTF9pO6ysUUUYuCZpIXyc2 X-Google-Smtp-Source: AMsMyM5yPtrJ9EuPUxmiGO1piIzX3nEcmsW841mHDBg8d5brBYDZI1vm95vwBUkwAAKAiiFC7ya0Kw== X-Received: by 2002:a05:6402:d6c:b0:458:ef3d:5926 with SMTP id ec44-20020a0564020d6c00b00458ef3d5926mr727593edb.54.1664693150376; Sat, 01 Oct 2022 23:45:50 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:51d0:b0:43d:b3c4:cd21 with SMTP id r16-20020a05640251d000b0043db3c4cd21ls7950388edd.2.-pod-prod-gmail; Sat, 01 Oct 2022 23:45:49 -0700 (PDT) X-Received: by 2002:a05:6402:1e96:b0:451:129e:1a2c with SMTP id f22-20020a0564021e9600b00451129e1a2cmr14203260edf.60.1664693149109; Sat, 01 Oct 2022 23:45:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664693149; cv=none; d=google.com; s=arc-20160816; b=TJRUUKewmZW3mxtd82Qp2ZwGPaD5P0Wlv0kdC8o84YGuileMUzPyw9uioe2WsKz8Up GYmQTRW83H6eg40D49jHVo0iV0nBVdhSgZyBBF76xK5pjUYrgifQlKTlT7adohKwp05M RHYKgD41L3tcrfq9JFKzwXaYkb43je4Rr1njgzoERW3CR+M1d/HuK9D66zu55sK0nBIL Ra9250eMVm1qeT+zsO4+rJZaos9KCrLXUMDINZ6K6I4qSlDRAUJnAuSlVeg0f7kY22Et zIMS7BWCEzyjlmN7fLS1tZy8X8pIqJwMOxNJwtekLYIWus+Cm15MKIUD8rm7FuBEQcKa ry6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=riE4lHaMXHSULeXJrv4hqGT03pNNa5PlNR8v7ryuD60=; b=NkzSWmLyQUS4seEASrcYDG45Wp+ALk+aTTcaBKCH56lKd6q49awmvc1sKDvGskwYV1 l8x5PyU0NGEvnReOipDL2Hklqjs5YnghyjMFZMsZhdSMyXQmXdzWBTuogFUNiCnufa8q gJKhGm4UeV4DGeBcFKkvwhL42PPBXR8EGo5pHq/ySCxKOGWyY73IvMxWloi5b/INWe++ 3Iu7AGjkRDSZPXZyIWODsPvMLb+A+hfqbgj6axLdsmOaWczmiUIATmFxXp01CVUN5kkk P2iOd7vuj0qHtUmD4mskeDPYx4pI03z+pK77eHGH4gF6ms5IZavBxsApq/h4nxcOir0q 59sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rsLBLijZ; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 14-20020a50874e000000b00457f1c53aa7sor2937460edv.28.2022.10.01.23.45.49 for (Google Transport Security); Sat, 01 Oct 2022 23:45:49 -0700 (PDT) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6402:448c:b0:457:52eb:b57e with SMTP id er12-20020a056402448c00b0045752ebb57emr14243393edb.178.1664693148777; Sat, 01 Oct 2022 23:45:48 -0700 (PDT) Received: from panicking.. ([109.52.206.103]) by smtp.gmail.com with ESMTPSA id 26-20020a170906329a00b0077f5e96129fsm3569894ejw.158.2022.10.01.23.45.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Oct 2022 23:45:48 -0700 (PDT) From: Michael Trimarchi To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , David Airlie , Daniel Vetter Cc: Kishon Vijay Abraham I , Vinod Koul , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-amarula@amarulasolutions.com Subject: [RFC PATCH 3/4] phy: rockchip: Implement TTY phy mode Date: Sun, 2 Oct 2022 08:45:39 +0200 Message-Id: <20221002064540.2500257-4-michael@amarulasolutions.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221002064540.2500257-1-michael@amarulasolutions.com> References: <20221002064540.2500257-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rsLBLijZ; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The rockchip phy can be programmed in 3 modes: - dsi - lvds - ttl For instance in px30 there are two sets of rgb interface pins m0 and m1. The logic can go outside from the VOP using m0 set or go outside using the m1 set and the ttl logic enable. There are combination where a set of pin can be taken from m1 and m0 where all the two path are enabled. dsi and ttl enable share one register in their register area. Simple implementation is overlap the area where we want access the register Signed-off-by: Michael Trimarchi --- .../phy/rockchip/phy-rockchip-inno-dsidphy.c | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c index 644cf73cfd53..0af50d2e0402 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c @@ -217,6 +217,17 @@ static void phy_update_bits(struct inno_dsidphy *inno, writel(tmp, inno->phy_base + reg); } +static void host_update_bits(struct inno_dsidphy *inno, + u32 reg, u32 mask, u32 val) +{ + unsigned int tmp, orig; + + orig = readl(inno->host_base + reg); + tmp = orig & ~mask; + tmp |= val & mask; + writel(tmp, inno->host_base + reg); +} + static int inno_is_valid_phy_mode(struct inno_dsidphy *inno) { switch (inno->mode) { @@ -224,6 +235,10 @@ static int inno_is_valid_phy_mode(struct inno_dsidphy *inno) break; case PHY_MODE_LVDS: break; + case PHY_MODE_TTL: + if (IS_ERR(inno->host_base)) + return -EINVAL; + break; default: return -EINVAL; } @@ -506,6 +521,32 @@ static void inno_dsidphy_lvds_mode_enable(struct inno_dsidphy *inno) LVDS_DATA_LANE2_EN | LVDS_DATA_LANE3_EN); } +static void inno_dsidphy_ttl_mode_enable(struct inno_dsidphy *inno) +{ + /* Select TTL mode */ + phy_update_bits(inno, REGISTER_PART_LVDS, 0x03, + MODE_ENABLE_MASK, TTL_MODE_ENABLE); + /* Reset digital logic */ + phy_update_bits(inno, REGISTER_PART_LVDS, 0x00, + LVDS_DIGITAL_INTERNAL_RESET_MASK, + LVDS_DIGITAL_INTERNAL_RESET_ENABLE); + udelay(1); + phy_update_bits(inno, REGISTER_PART_LVDS, 0x00, + LVDS_DIGITAL_INTERNAL_RESET_MASK, + LVDS_DIGITAL_INTERNAL_RESET_DISABLE); + /* Enable digital logic */ + phy_update_bits(inno, REGISTER_PART_LVDS, 0x01, + LVDS_DIGITAL_INTERNAL_ENABLE_MASK, + LVDS_DIGITAL_INTERNAL_ENABLE); + /* Enable analog driver */ + phy_update_bits(inno, REGISTER_PART_LVDS, 0x0b, + LVDS_LANE_EN_MASK, LVDS_CLK_LANE_EN | + LVDS_DATA_LANE0_EN | LVDS_DATA_LANE1_EN | + LVDS_DATA_LANE2_EN | LVDS_DATA_LANE3_EN); + /* Enable for clk lane in TTL mode */ + host_update_bits(inno, DSI_PHY_RSTZ, PHY_ENABLECLK, PHY_ENABLECLK); +} + static int inno_dsidphy_power_on(struct phy *phy) { struct inno_dsidphy *inno = phy_get_drvdata(phy); @@ -533,6 +574,9 @@ static int inno_dsidphy_power_on(struct phy *phy) case PHY_MODE_LVDS: inno_dsidphy_lvds_mode_enable(inno); break; + case PHY_MODE_TTL: + inno_dsidphy_ttl_mode_enable(inno); + break; default: return -EINVAL; } @@ -561,6 +605,10 @@ static int inno_dsidphy_power_off(struct phy *phy) LVDS_PLL_POWER_MASK | LVDS_BANDGAP_POWER_MASK, LVDS_PLL_POWER_OFF | LVDS_BANDGAP_POWER_DOWN); + /* Disable for clk lane in TTL mode */ + if (!IS_ERR(inno->host_base)) + host_update_bits(inno, DSI_PHY_RSTZ, PHY_ENABLECLK, 0); + pm_runtime_put(inno->dev); clk_disable_unprepare(inno->ref_clk); clk_disable_unprepare(inno->pclk_phy); @@ -576,6 +624,7 @@ static int inno_dsidphy_set_mode(struct phy *phy, enum phy_mode mode, switch (mode) { case PHY_MODE_MIPI_DPHY: case PHY_MODE_LVDS: + case PHY_MODE_TTL: inno->mode = mode; break; default: @@ -630,6 +679,10 @@ static int inno_dsidphy_probe(struct platform_device *pdev) if (IS_ERR(inno->phy_base)) return PTR_ERR(inno->phy_base); + inno->host_base = devm_platform_ioremap_resource(pdev, 1); + if (IS_ERR(inno->host_base)) + dev_warn(dev, "TTL mode is not supported\n"); + inno->ref_clk = devm_clk_get(dev, "ref"); if (IS_ERR(inno->ref_clk)) { ret = PTR_ERR(inno->ref_clk); From patchwork Sun Oct 2 06:45:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 2416 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 82EDB3F331 for ; Sun, 2 Oct 2022 08:45:52 +0200 (CEST) Received: by mail-ed1-f72.google.com with SMTP id b16-20020a056402279000b0044f1102e6e2sf6763029ede.20 for ; Sat, 01 Oct 2022 23:45:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664693152; cv=pass; d=google.com; s=arc-20160816; b=mGbmQpe2Y4nKCjo6lLUWq5URwAZp58NDrVDHb8c6nKw6TAaLKcG0rxwokGs+nR+VPn z0MfLJPg5wP+nrWZuvUluLguLTK/lLkDWlj9tz8qTm5+Cjgh1aNno3m+ftL0ZczhsNba dbciLpKhXd662i7kT+CkKhMTVxLJbFJ9HsoauqVrSvykMAWrxbBlvNjj6V2Ef27MrVfc ciFXiKdj4XAfGGrfkb02KfsSXLcCpK5MBadOUzyoE5v3/8HD9hmShR5yoxlZxjoMIg7e oB9K50FgzW/a6HokjS+2g5uLKHi6zTYd1McfnWLT8nT0dqPm0qmtV0CnRvdJ9o52yWOy LLYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=pNk0KmeAaPBBgH8rf2/myOUZMQfYE0ygligWws/SSIQ=; b=eYW8i6QLOjUdOAk+hFo0zuLBHNVpsSHhll8h1vZLUTHsuv6om/+s6P6NGNa066F8kr xfU3JXrItlOvtKIwVLCcHomL1DBcHJyrp7RFikbjBNUABEBOHlYc9WBFVDe6VD/4NEhs JtYYhZKEJt2P3B2s//c/FUQtuRs8QH41wmQM4ysVHcDKAZok6u76avRT499xnb159w3+ TQDpUX8Qj5VHEaUDaJz8ZPCIyG12m1k1RBU7pWkDtWEysXCA3KAo3srT73SNWi7efelf YrX/wl3vMPrnm/TPQPDMgk0+lOpUjCKQD3OiGKLGQugvI2n8eQStAdD1lpma5iYOgl1p yayg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=omdSgHFq; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date; bh=pNk0KmeAaPBBgH8rf2/myOUZMQfYE0ygligWws/SSIQ=; b=OdFACohoOJGvR5BzaX7htUxZNqPteXxGDrpspyCKE12aDPonToDBnfOJ6dWdvinC/i +ULsBe3R6FWRkUfW+wNXayXsHGlVosRe2ABdk23SCHY9Z6nPW7G464tVmfWuAZSkJJ0k sejyzGNzfinjDoMHwKpcYn7OwlJ6rj/6DJICs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=pNk0KmeAaPBBgH8rf2/myOUZMQfYE0ygligWws/SSIQ=; b=kYlJSUajhQ8hE4wPPYUomOqaVc/znEvfw2td69itiA90wWuTn4yqJD/a5WHU6zPsNa xLTKc0mKr3QbzCR95xgOSOoSvAlLFznbgohyLq20pNcGj/Y5HfVXps1xn8X6EViGXeHR JL6pT0lOwU2NrVF2VcEOQRphc9sempghNjQ9T/SgDDPjHxt4SgknPVSiFp5iwvBoy3zO sz+XMRNEO6DhhrLtw/2YmV7ijCXyNfbk0zjmHrkvHGbKYAKrRAjH8sLzjra9no25iXKj /n5lGAnhKX2cymEI+f8cvYfnIEocaX44MZsSexbIdJiEkzhEu35wAxsfnBGCX9diDXWn 77wg== X-Gm-Message-State: ACrzQf3pt5ngO5HV5StxI+N+q7xtnrWy9xGJsXKTVl2vHlWhf3nz3Dbn ExpvgFuIVoGsoN5Q6HTyqH7xW6hM X-Google-Smtp-Source: AMsMyM4SjfT7pVfuyJIgL2U0E/ixyyuIWGwFuI6yyDtPCprIXhw5X5D0TFvPHbj/cj6YYv4huxccFA== X-Received: by 2002:a05:6402:3806:b0:450:bad8:8cd5 with SMTP id es6-20020a056402380600b00450bad88cd5mr14305693edb.305.1664693152188; Sat, 01 Oct 2022 23:45:52 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:906:a10a:b0:77d:b590:5e60 with SMTP id t10-20020a170906a10a00b0077db5905e60ls4001841ejy.8.-pod-prod-gmail; Sat, 01 Oct 2022 23:45:51 -0700 (PDT) X-Received: by 2002:a17:907:2bd5:b0:76f:591c:466b with SMTP id gv21-20020a1709072bd500b0076f591c466bmr11041818ejc.504.1664693150836; Sat, 01 Oct 2022 23:45:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664693150; cv=none; d=google.com; s=arc-20160816; b=l+ePdkNnuExnrBJwn0u8jmGu2xbvPV8DmgTjwNwWiGtDGrMZvotUvYwSxGjXlYeahV uNUCq+lGmS57tnIJ5gIWwiqEWBfqJLmW/3Oq63QLnRS3kTIQ/jtyrwPOroc27SAMcAta 3nnVFUHPz5TOv5Z2l5o2akEL8X3F6Q+iHbkOXlJWlyt0tyXir/GNi4t3Y8ZjMFS6PC+9 umZmz0mpoX9dfJrEswOleAy6/xsqVO920vyCk5JU8TXJ5aCxlJB1Su6gjZphxBb56fVH w0/jpzyiRlVxOatM2iJRzQSFLF9WgM8r9UGgQGtwfbVnzA7HTtp9uny7NLGH3EJS+jWq r8Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=gtEJxbrwC/UQVf48sJy2NN3O3k5LpfsDQAoSkyusABE=; b=FdNp+W0CSOfabtmmAnxwc39kMRbw7bvxeuUDmS78geoGAzBlBi+PP34n9FhE03qBIF AgF7zDvH5fM22uS34A94b8Jqq9juLqBFAmjeVTvYzw53u8JMQEO+FQQlc//osVNJ/dUj VuoSX1Fim8ug34r59Ca5hKNkqH+06jnlfbRZ3jJYZw5halIVnWn8pHk9blPDDgNuf3Jv XQPfQsSURrvzpsSVo9i8mhkz0GcEQ3ezAwq/7V2x7kM8b3Tidy9Af7ksnn8LXFkHioVP qxIG4JySHV+kdFZ/n1dw2DZK04jlDDDwjwyz40GrnDCygNJfX6vf9GxobWnAao5lHMmS b+9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=omdSgHFq; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id n19-20020a1709067b5300b0073dde87e10dsor2262593ejo.79.2022.10.01.23.45.50 for (Google Transport Security); Sat, 01 Oct 2022 23:45:50 -0700 (PDT) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:907:3205:b0:770:8554:c4ee with SMTP id xg5-20020a170907320500b007708554c4eemr11785485ejb.39.1664693150522; Sat, 01 Oct 2022 23:45:50 -0700 (PDT) Received: from panicking.. ([109.52.206.103]) by smtp.gmail.com with ESMTPSA id 26-20020a170906329a00b0077f5e96129fsm3569894ejw.158.2022.10.01.23.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Oct 2022 23:45:50 -0700 (PDT) From: Michael Trimarchi To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , David Airlie , Daniel Vetter Cc: Kishon Vijay Abraham I , Vinod Koul , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-amarula@amarulasolutions.com Subject: [RFC PATCH 4/4] drm/rockchip: rgb: Add dphy connection to rgb output Date: Sun, 2 Oct 2022 08:45:40 +0200 Message-Id: <20221002064540.2500257-5-michael@amarulasolutions.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221002064540.2500257-1-michael@amarulasolutions.com> References: <20221002064540.2500257-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=omdSgHFq; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Dispite the commit 1f0f015151727, the rgb output has an option to allow to sent the output pin using the dsi/lvds/ttl logic. The only way to do and stay on the same design is let the rockchip_rgb block to grab the handle if it is present and enable it. The present of this handle depends on dts configuration I have a full working example with an hardware with mixed lines on direct logic and using the phy, with the follow dts example: panel: panel { compatible = "panel-dpi"; ... panel-timing { clock-frequency = <30000000>; ... }; port { panel_rgb_in: endpoint { remote-endpoint = <&vopb_out_rgb>; }; }; }; &vopb_out { vopb_out_rgb: endpoint@2 { reg = <2>; remote-endpoint = <&panel_rgb_in>; }; }; &vopb { status = "okay"; pinctrl-names = "default", "sleep"; pinctrl-0 = <&lcdc_rgb_pins>; pinctrl-1 = <&lcdc_sleep_pins>; phys = <&dsi_dphy>; phy-names = "dphy"; }; Signed-off-by: Michael Trimarchi --- drivers/gpu/drm/rockchip/rockchip_rgb.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_rgb.c b/drivers/gpu/drm/rockchip/rockchip_rgb.c index 75eb7cca3d82..c725774a0f40 100644 --- a/drivers/gpu/drm/rockchip/rockchip_rgb.c +++ b/drivers/gpu/drm/rockchip/rockchip_rgb.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -30,6 +31,7 @@ struct rockchip_rgb { struct drm_bridge *bridge; struct drm_encoder encoder; struct drm_connector connector; + struct phy *dphy; int output_mode; }; @@ -168,6 +170,22 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev, goto err_free_connector; } + /* PHY */ + rgb->dphy = devm_phy_get(dev, "dphy"); + if (!IS_ERR(rgb->dphy)) { + ret = phy_init(rgb->dphy); + if (ret) + return ERR_PTR(ret); + + ret = phy_set_mode(rgb->dphy, PHY_MODE_TTL); + if (ret) + return ERR_PTR(ret); + + ret = phy_power_on(rgb->dphy); + if (ret) + return ERR_PTR(ret); + } + return rgb; err_free_connector: