From patchwork Tue Apr 9 20:49:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10892427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 50D8117E1 for ; Tue, 9 Apr 2019 20:49:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EC3C28980 for ; Tue, 9 Apr 2019 20:49:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C05B28970; Tue, 9 Apr 2019 20:49:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CEBA32897C for ; Tue, 9 Apr 2019 20:49:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=6ZPWUM0udSn9ZM9hJdVBmCdmpaLkQj8v6DIsUhIqvY4=; b=KesP980LeMr/Jo mF1CgKAHEkOygtu951e7c+Mj1RQO+jlRSlu1rIsFlUN/R2NIW4vIkrTe6Y0o1/FbcidllIbuTLWQw VQiNiCY3rEHeYBRhuxWvTT+u1v9A8g8Bzz0o0l6kadK0jMqcZOdI3vkmQoSio0WEZoxL3SzVCTqJh o64oJZHUBxeS+FGJyX/U/42ct8dKp8DUlUKlD8T6DefkxrAayBEyN3hFHo2pK7IOaYl1Diva5KVWt ClrblKn8QNRhsvCETxauC1xkA2Kuh60m4Q6uHPbHmWvdOPbVyiNfe2R6FCiQNB6L3uNJmHQrvFjZ7 X6dvD5+1NzvTIJIcaDvg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDxgH-0002s8-S5; Tue, 09 Apr 2019 20:49:21 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDxgA-0002kF-0m for linux-rockchip@lists.infradead.org; Tue, 09 Apr 2019 20:49:15 +0000 Received: by mail-pl1-x642.google.com with SMTP id t16so10137910plo.0 for ; Tue, 09 Apr 2019 13:49:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XlYzZy8TYO5PMiZ/P87s3/AMR2PGS6dQ+mqKjGyhDdQ=; b=j/P7HvSGfharjDN338Ohh0VmEVGNHqh9aoAYdfaUqcWqyMAJ5wyY+lKGlXis0jdn1M J+/iWmHtUFJgYO45NLPe/B4jKKg7bVt3g0gCVM+BqSNWzn42GQSuWocup1Rv/4pJTwQC jEesh+eo6/oajNOj9xCxn2yL4GSC3PdaSCMq0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XlYzZy8TYO5PMiZ/P87s3/AMR2PGS6dQ+mqKjGyhDdQ=; b=XDJ3IQAU++V4ErDXbBI+QjWElMEnHYvE2zYATHHutQd7Fpr1cPuv91mJroab8kBD5n W7bhv9NA0hI2GmLMQsM0vnQFRHB5guenSzMuZrSZxusAEBoltplz3voUDyMMilnfa9ss IiIom8XpBRRMXoiOrgKt6AReybn9ZEPJbYE1OUAcpr9pRhs1TVjmJ7D35Gl/hnDNnU1I Ys/RUuUmEWOaLQE+FBwuGyClDgRfVEv+1pMahQU6vt2ZJH7grb6A+iQqaa6F9qOtyRnz KQGqhVQDmeEJGaqWmDFH/gcCil1zuKHnYXIxdPakpxFVpTXOztkNevdzJv2Gxt5qTo7D Rqxw== X-Gm-Message-State: APjAAAUF6HG/jmh1ugjXDmAkllkm4xRds0fYBEdGVCvQkrWtJJ/p+zdT skO91+eHwYaAG+nDGcyIkkpFDw== X-Google-Smtp-Source: APXvYqx8nR26wlcezqVkZiGwrmjJLH83E3OxO61TrSgWpEDGkyEDTRG5cgFmn4sKiB4fIhRzSbZBgA== X-Received: by 2002:a17:902:141:: with SMTP id 59mr3322848plb.132.1554842953307; Tue, 09 Apr 2019 13:49:13 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id x9sm54349543pfn.60.2019.04.09.13.49.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Apr 2019 13:49:12 -0700 (PDT) From: Douglas Anderson To: Heiko Stuebner Subject: [PATCH] soc: rockchip: Set the proper PWM for rk3288 Date: Tue, 9 Apr 2019 13:49:05 -0700 Message-Id: <20190409204905.152432-1-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190409_134914_060648_CE7E7885 X-CRM114-Status: GOOD ( 13.39 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, mka@chromium.org, ryandcase@chromium.org, Caesar Wang , linux-arm-kernel@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The rk3288 SoC has two PWM implementations available, the "old" implementation and the "new" one. You can switch between the two of them by flipping a bit in the grf. The "old" implementation is the default at chip power up but isn't the one that's officially supposed to be used. ...and, in fact, the driver that gets selected in Linux using the rk3288 device tree only supports the "new" implementation. Long ago I tried to get a switch to the right IP block landed in the PWM driver (search for "rk3288: Switch to use the proper PWM IP") but that got rejected. In the mean time the grf has grown a full-fledged driver that already sets other random bits like this. That means we can now get the fix landed. For those wondering how things could have possibly worked for the last 4.5 years, folks have mostly been relying on the bootloader to set this bit. ...but occasionally folks have pointed back to my old patch series [1] in downstream kernels. [1] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1391597.html Signed-off-by: Douglas Anderson --- drivers/soc/rockchip/grf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/soc/rockchip/grf.c b/drivers/soc/rockchip/grf.c index 96882ffde67e..3b81e1d75a97 100644 --- a/drivers/soc/rockchip/grf.c +++ b/drivers/soc/rockchip/grf.c @@ -66,9 +66,11 @@ static const struct rockchip_grf_info rk3228_grf __initconst = { }; #define RK3288_GRF_SOC_CON0 0x244 +#define RK3288_GRF_SOC_CON2 0x24c static const struct rockchip_grf_value rk3288_defaults[] __initconst = { { "jtag switching", RK3288_GRF_SOC_CON0, HIWORD_UPDATE(0, 1, 12) }, + { "pwm select", RK3288_GRF_SOC_CON2, HIWORD_UPDATE(1, 1, 0) }, }; static const struct rockchip_grf_info rk3288_grf __initconst = {