Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2016039ybi; Thu, 20 Jun 2019 07:47:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwIEaOA5nyQ2fQBLmuozXofXDTCgARc+sUEjFri5aQ1qT8pjrqTTYPmK13Ynn68NaAYlVt2 X-Received: by 2002:a17:90a:2ec1:: with SMTP id h1mr3489189pjs.101.1561042052547; Thu, 20 Jun 2019 07:47:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561042052; cv=none; d=google.com; s=arc-20160816; b=Xyp5zEhq0Spu06UnmQCdaUDv9pC1zOOSVkACE5TUt21aPeWzn/R+/UK2GQALjHFVZP LHkEWNiqAqrdOvxNQRQJjiQweJU3ftaDaqyEqgdY0PQ6n2phHlaASiwU2WPKNC2JYaCm 5rGtE1tLGXTUQLxGNyG/wf9yOVKAOe5FRa0HW8cFvccG4pG9/ceFiumdoKz9t0vYtUT4 1MWmHpIGHoNxHdRlwi49qc/3Mxesl9e5jqYwzjw6Am/rzhdImgsO9Wk5eKr9T3B/PjJe czZDNZXj3eCERDwz1WTogoujURe330rmmPnovuUGqnF2K7oNlFRAcuM9aLS9WamIU0Ju /8PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=oyyHT2lwIblI7pqbXaGA8lthaH3RzK0tbWj+O93TtPs=; b=VmZNYxqr83q273qU41/NuHACoYEFK3Rynx0qxYDpRg9XxmaH9xiEo3fybacf3cEJP0 ki9N7bRjPvscU96YheEPAk8VHNYU1rnEVBxsecHLNgaItQluLS2m/JoYLbRPAwkFX42T YjlzSshhFHHYcg6qkDy/o4U4a9H2Arxw+20EfXqg3wva/o7fmsxm/85SyYHkpkSsr5SK OZWp0UhVEpyj9eHWNiXbJX8UYWLAR/XPQN5J1h9Xz4w3OanMLs2SCcOGEgIA+i/Z/wpT wxowcu87/ffvtnLcmWzrifuTQ2JARa/dgZ1eeBdaC5+tr6ZmWQG6nrZKvrEg3UZRzgTA ygow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Oit0hFLJ; 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 v13si12055909pfe.217.2019.06.20.07.47.17; Thu, 20 Jun 2019 07:47:32 -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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Oit0hFLJ; 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 S1731511AbfFTOrC (ORCPT + 99 others); Thu, 20 Jun 2019 10:47:02 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:45981 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726921AbfFTOrA (ORCPT ); Thu, 20 Jun 2019 10:47:00 -0400 Received: by mail-wr1-f67.google.com with SMTP id f9so3290302wre.12 for ; Thu, 20 Jun 2019 07:46:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oyyHT2lwIblI7pqbXaGA8lthaH3RzK0tbWj+O93TtPs=; b=Oit0hFLJiNyL9EMSEqexEcPXKgySrpANwU0lVIrg7hHPpm+tC6du8Xwa0nqH+37qDB kVnMVGC2CbL6Xo8bWlAAVR7wzML9t8QatRqDQ9OFvVXs8Ko1+a2DqPqv5O4Ae9CpT+VH CbZvW0Kzy524h244pqvDUS9FQfHcOgiejizU+DFkR3HOW4UPSp9Oy74e8/nSVk/+vl+E zqte5zaoEnGWau1/BoAmgAm3CQ1P1GfPd1/gkdEKfe3BGnWbyX0Fr5oitGvMIrPOVtvf 0K5V1191mLtxlfVEZTgf3fAhq9Kj5m5n6y8+WbvdikSJNUNP5cceEUwEbjc+YrwUl9oe 8vkw== 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=oyyHT2lwIblI7pqbXaGA8lthaH3RzK0tbWj+O93TtPs=; b=Ybhd0JwTUTf4SaQzlQaVxIl8DlICT9SEqzj+f79v8wxbYCtlKrshexgU5dypMq47b+ uHjI1VFUd+RUteq7xsz/x2n5x+kYT+VrKmXOWZ4p8Twwj2yAbJhKYTc/kqHcOwHgYjAA lh6v6rc142MZoaIgPbgvhXEFfeLzhj9nCVQ4+YhNVl1B5Cw++lkSvOOqFPoJ+n+9E6Qn LHtBDAbISx95L6g/bjL8FtnnFH2n8TIqt4CAOWqFC/nC8p3l+X3l12OGPkcFOQRfRK7W 0S6p/2g1YpN/33kYnd4lt2MDVyMIe9ZCfg3Bt7HCc4ld0PTAmPZMGaHN5qX5wQvKFCiR AT+Q== X-Gm-Message-State: APjAAAWs4bAxh5Hgb9Y8aaA8JnbbY/8HnbiqVd7n1HL9c7oznh+Al/Th TodWwOC90h908V5ZN9Im0+EGVQ== X-Received: by 2002:adf:e442:: with SMTP id t2mr17566195wrm.286.1561042018342; Thu, 20 Jun 2019 07:46:58 -0700 (PDT) Received: from bender.baylibre.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id i25sm11297806wrc.91.2019.06.20.07.46.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Jun 2019 07:46:57 -0700 (PDT) From: Neil Armstrong To: thierry.reding@gmail.com Cc: Neil Armstrong , linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, martin.blumenstingl@googlemail.com Subject: [PATCH] pwm: meson: fix the G12A AO clock parents order Date: Thu, 20 Jun 2019 16:46:55 +0200 Message-Id: <20190620144655.2142-1-narmstrong@baylibre.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Amlogic G12A and G12B Documentation is wrong, the AO xtal and clk81 clock source order is reversed, and validated when adding DVFS support by using the PWM AO D output to control the CPU supply voltage. The vendor tree also uses the reversed xtal and clk81 order at [1]. [1] https://github.com/hardkernel/linux/blob/odroidn2-4.9.y/drivers/amlogic/pwm/pwm_meson.c#L462 Fixes: f41efceb46e6 ("pwm: meson: Add clock source configuration for Meson G12A") Signed-off-by: Neil Armstrong --- drivers/pwm/pwm-meson.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c index 5e65b042c240..e15d045947bb 100644 --- a/drivers/pwm/pwm-meson.c +++ b/drivers/pwm/pwm-meson.c @@ -453,8 +453,17 @@ static const struct meson_pwm_data pwm_axg_ao_data = { .num_parents = ARRAY_SIZE(pwm_axg_ao_parent_names), }; +static const char * const pwm_g12a_ao_ab_parent_names[] = { + "xtal", "aoclk81", "fclk_div4", "fclk_div5" +}; + +static const struct meson_pwm_data pwm_g12a_ao_ab_data = { + .parent_names = pwm_g12a_ao_ab_parent_names, + .num_parents = ARRAY_SIZE(pwm_g12a_ao_ab_parent_names), +}; + static const char * const pwm_g12a_ao_cd_parent_names[] = { - "aoclk81", "xtal", + "xtal", "aoclk81", }; static const struct meson_pwm_data pwm_g12a_ao_cd_data = { @@ -498,7 +507,7 @@ static const struct of_device_id meson_pwm_matches[] = { }, { .compatible = "amlogic,meson-g12a-ao-pwm-ab", - .data = &pwm_axg_ao_data + .data = &pwm_g12a_ao_ab_data }, { .compatible = "amlogic,meson-g12a-ao-pwm-cd", -- 2.21.0