Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp849321yba; Wed, 15 May 2019 11:01:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFukOk8O1NR7dwsJY8i7+wmX2+Xa7K6XywQzDEhtfmYMIKDIKdoEOu6PGrcsPxNR47Xl3G X-Received: by 2002:a63:a50c:: with SMTP id n12mr27906823pgf.175.1557943261744; Wed, 15 May 2019 11:01:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557943261; cv=none; d=google.com; s=arc-20160816; b=XWUkLo3UhHG+aG3rRIGfzbXG7huRt4fpnHtZ6BHTQzW/WzzG77XghYTRdJz1X+QL+B pA4B20wExPzYYqYPzPck1NVfJeXEkG9IZYX7nkd+71E3neEIklSvNWXTTJpz9OhWTIQF RqVJN1UEGEfb4VBm/+5vmfpAdk2Lj7VEXOvv2v2H6gw/aipEjAYNOV+SIF0zwO9jl9Aj 9L2mPOfaLkwoWTyvVlKW2w63vetGrBKzodeHKbDSay1RmJRPK3Ha7ggyISCO05UomyFT Q3YGLnLVfdyGSjT410xipk/pDd0ZOpdhA7oNfhIqhW6wwW30ThhdKvvB/7kHeTcfT3Sq TFlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=T3r53rpcIIdNWUWUX1L2hWGIMIpNyc3n74ZjaoYk6ds=; b=HZJ9Adceks9zGPD7pgkSrI6DYPHX3LKF4nMy0jmoWzSe6geiqL6+QNBfBcby9ixZ0U HhryHl2yE1yVlhSmKX1c2ItnNuTXVhdoM7krCXQ/RfLTffkIBEV4r3uTUVEcjW7FcAk0 +BBypsPAzlU3FDeY2hcfZ1f9nUFh570yRtTZR/XMwx3OwIlPQmJii6/BtCYVIs7UMe7j sc7emo7A+pGJ2GeixsUzrPWOnYY+f1oziJztqBHT39ziyE8O+t53wW6EGiZGhprdjbUp CS7o+vo/LliZnbby6x6BI5PIzgJHht/S32s8OtYF/mPK7WRpxgZDhgBnT0CeTFd4BGZS FMHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=eseIQ+3p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 59si2333918plp.62.2019.05.15.11.00.45; Wed, 15 May 2019 11:01:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=eseIQ+3p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727339AbfEOR63 (ORCPT + 99 others); Wed, 15 May 2019 13:58:29 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:46259 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726335AbfEOR62 (ORCPT ); Wed, 15 May 2019 13:58:28 -0400 Received: by mail-qt1-f194.google.com with SMTP id z19so655811qtz.13 for ; Wed, 15 May 2019 10:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=T3r53rpcIIdNWUWUX1L2hWGIMIpNyc3n74ZjaoYk6ds=; b=eseIQ+3pKjwi0X7F8OvMJCGH+HwZS6LhXVbIONYoL/PKENiZd2gBx4UBYRuji8jiEz tD88w0+QZEhw7cKzTo63UlK+YINRL+VWCip+4N3tBcGJSycvR0Ev+BpmtCGXOEy2yn3q JoVdLsd/Wqhl6EcS55EdOIKpoybnyFmpMO9025SzEQrJE+87AypjP1QVb4fqnaJqnf44 UxjWWas+DUpvhH2w59bKq25kU2Z5a2f5tLERhAySrspY7lXuUdOZ1HmI3cHdAiDuEc8S tcTdq4CwbibmjtyJVfzkkupk4W88fJj0J3yhJYwZy4Hv7kOednw2Y4NGqJ4aXF0mMHUf 5yFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=T3r53rpcIIdNWUWUX1L2hWGIMIpNyc3n74ZjaoYk6ds=; b=q2PYccG5O6D08QHMvPb+6DcuhA5hQUfxwlTRoWY81dMvesPXx7XERow35YY7nJrqs2 PksPRk1BFy6CT8J+BMf8pPefT3LxusqoBhzU0n8wQ4YDauYhwKirUt2gFaaHSJRfC5MW YUDgebbKJeQ9uegsZWKCnN1JIx3Q7MUUAVdu357wXpXTnbrg4sSRGd1Ow69p8q3pCCgp s8Ytc9+/bR5dyHOMNgWyobsMJf4ChqNyUYTjjVgMyjieD22ilMC1TlOG4gNQ6LY5gxLs nN25wijXxp9yDIJJUaB46wtHmyZI5NydkJsIQNlWD1A5Al60UyI7hLNoxWTpP+8iJ0MA +vFQ== X-Gm-Message-State: APjAAAXt8fpCQmUPa194EdWtYnXvJL3sJ6AuC9Fv07r33r6nc34ZBCPm 7mfvUTbh0oVno0oTKSNmzfIyUw== X-Received: by 2002:a0c:d17b:: with SMTP id c56mr15467538qvh.61.1557943107807; Wed, 15 May 2019 10:58:27 -0700 (PDT) Received: from localhost ([2620:0:1013:11:89c6:2139:5435:371d]) by smtp.gmail.com with ESMTPSA id k89sm1491911qte.33.2019.05.15.10.58.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 May 2019 10:58:26 -0700 (PDT) Date: Wed, 15 May 2019 13:58:26 -0400 From: Sean Paul To: Douglas Anderson Cc: Heiko Stuebner , Sandy Huang , Andrzej Hajda , Laurent Pinchart , linux-rockchip@lists.infradead.org, Neil Armstrong , mka@chromium.org, Sean Paul , Zheng Yang , Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , David Airlie , Jernej Skrabec , Daniel Vetter Subject: Re: [PATCH 1/2] drm: bridge: dw-hdmi: Add hooks for suspend/resume Message-ID: <20190515175826.GT17077@art_vandelay> References: <20190502223808.185180-1-dianders@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190502223808.185180-1-dianders@chromium.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 02, 2019 at 03:38:07PM -0700, Douglas Anderson wrote: > On Rockchip rk3288-based Chromebooks when you do a suspend/resume > cycle: > > 1. You lose the ability to detect an HDMI device being plugged in. > > 2. If you're using the i2c bus built in to dw_hdmi then it stops > working. > > Let's add a hook to the core dw-hdmi driver so that we can call it in > dw_hdmi-rockchip in the next commit. > > NOTE: the exact set of steps I've done here in resume come from > looking at the normal dw_hdmi init sequence in upstream Linux plus the > sequence that we did in downstream Chrome OS 3.14. Testing show that > it seems to work, but if an extra step is needed or something here is > not needed we could improve it. > > Signed-off-by: Douglas Anderson > --- > > drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 21 +++++++++++++++++++++ > include/drm/bridge/dw_hdmi.h | 3 +++ > 2 files changed, 24 insertions(+) > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > index db761329a1e3..4b38bfd43e59 100644 > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > @@ -2780,6 +2780,27 @@ void dw_hdmi_unbind(struct dw_hdmi *hdmi) > } > EXPORT_SYMBOL_GPL(dw_hdmi_unbind); > > +int dw_hdmi_suspend(struct dw_hdmi *hdmi) > +{ > + return 0; > +} > +EXPORT_SYMBOL_GPL(dw_hdmi_suspend); > + > +int dw_hdmi_resume(struct dw_hdmi *hdmi) > +{ > + initialize_hdmi_ih_mutes(hdmi); > + > + dw_hdmi_setup_i2c(hdmi); > + if (hdmi->i2c) > + dw_hdmi_i2c_init(hdmi); > + > + if (hdmi->phy.ops->setup_hpd) > + hdmi->phy.ops->setup_hpd(hdmi, hdmi->phy.data); > + > + return 0; > +} > +EXPORT_SYMBOL_GPL(dw_hdmi_resume); Both patches look good to me, I'd probably prefer to just smash them together, but meh. If no one more authoritative chimes in, I'll apply them to -misc in a few days. Sean > + > MODULE_AUTHOR("Sascha Hauer "); > MODULE_AUTHOR("Andy Yan "); > MODULE_AUTHOR("Yakir Yang "); > diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h > index 66e70770cce5..c4132e9a5ae3 100644 > --- a/include/drm/bridge/dw_hdmi.h > +++ b/include/drm/bridge/dw_hdmi.h > @@ -154,6 +154,9 @@ struct dw_hdmi *dw_hdmi_bind(struct platform_device *pdev, > struct drm_encoder *encoder, > const struct dw_hdmi_plat_data *plat_data); > > +int dw_hdmi_suspend(struct dw_hdmi *hdmi); > +int dw_hdmi_resume(struct dw_hdmi *hdmi); > + > void dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense); > > void dw_hdmi_set_sample_rate(struct dw_hdmi *hdmi, unsigned int rate); > -- > 2.21.0.1020.gf2820cf01a-goog > -- Sean Paul, Software Engineer, Google / Chromium OS