Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp529021ybh; Thu, 12 Mar 2020 06:32:35 -0700 (PDT) X-Google-Smtp-Source: ADFU+vugWvCxL3KESx9yAWJBrriNUxJ2+GVhSiaVNFDLEAjSpKHZPijCiECprlEuf8qRGWMO+n4I X-Received: by 2002:a4a:928f:: with SMTP id i15mr4098378ooh.38.1584019955181; Thu, 12 Mar 2020 06:32:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584019955; cv=none; d=google.com; s=arc-20160816; b=yP3ow49m3/QpmV1rOfMywPuk9Vi4qKDFasMaeZ2O8DRX8oBkSY2/tvPLRXuKoKCTNC 22ne5bGtm14aHRuXcgHGVrVIo6OwmXpdAt4t/wDGn8BTuQn0Spy+5iLqhfbtkxEiF6G5 Psz7uk05fNkAj7HunrURLKvZ1ebAWjZIeJwX2QIIylPTJd1VgjHxTvdTV+UHeRH9P+W5 VqW9z+ThIv1Q3J6TxqsiWemCXgNLQQ4wiu7OShvf/f6xtY6Jb0gXEck5ycI7AXyA39GF uYpBo/Bf4UYnlkcxxbmfs6d7nO4YWnfYMfIsaeFiV33VYYHtND1hxWh0UUFQneD7h5wz nYXA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qPH/Dy/CjLCenRWLG2Luxl8lE2WdXQS9qh3kQnsN4TQ=; b=B3RvZ4rgFNlFmciw7VEjr7eunplVhPGJZZ/Rv+HIzzrnxZ0qs3OQt/rfzalTWUF2z2 oH+AQaX+DkaqbHHZKiHtKcKt1Ch7y5BaSFeJdTiEdDfsR1wBrCaKPsN3eg2dy5x5kNWE E2LH61PQ+5M+90AiJUeLdPlSwAeKZghe/5+JCaWgUBmam5LzQm6mTLP6gwlP00ZzGctJ Y8zHUjj9+eoG30wIJFjimr1cg7Nk8Mg5apWtkPAnNMvpAWnZcgDanLyUFrMqAYYQWrsT FBPdzoL3TpCqV+EYYg4L/rsSB4PQDHPMHbh56EWigrl0Vi0FK1HrsNoktCC/Ci+PwRgd EbIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=hUCDqIj0; 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 34si2842720otv.21.2020.03.12.06.32.19; Thu, 12 Mar 2020 06:32:35 -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=hUCDqIj0; 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 S1727459AbgCLNbq (ORCPT + 99 others); Thu, 12 Mar 2020 09:31:46 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:35388 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727422AbgCLNbl (ORCPT ); Thu, 12 Mar 2020 09:31:41 -0400 Received: by mail-wr1-f65.google.com with SMTP id d5so7135581wrc.2 for ; Thu, 12 Mar 2020 06:31:40 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=qPH/Dy/CjLCenRWLG2Luxl8lE2WdXQS9qh3kQnsN4TQ=; b=hUCDqIj0/ip1fGR0w8g9JiTgR3VggFXz6uXZBIuxQFF8RI6pPBFb0oKUQZqohHTRzJ EHaOdl7mpyqXAh2wOch+xrBgXcNlimpN9pUcYfJPjcxIWvdkyqbSg9NQI7L5ScEkAZB4 rMQWh59snVY+t+sBELnc4M5c4DmKQy+T/hQ5cw5ip7/2BS8wARxIRgItz7sfFyakw9vk mlBrjYp4ALqFRuMLjLg7MJ0VyZcGPi4hjaD+7P3BdyiA5CPOMY/d5Ix0Gesh38EQ24E6 X5/Ga0uTigrBvfoDF9cVkNYXejKr5vaVSAdDmf2Fc1HVBFXkq/IRQFrjALiYCP+VQjwE a/qA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=qPH/Dy/CjLCenRWLG2Luxl8lE2WdXQS9qh3kQnsN4TQ=; b=QnD2vPL31DFUDyoizQQ5q/3tCLSqgjGrqKnC7Q7R8Mqdm4opw/9zwJZECh9DNrg/ax ZnRe/yx+3HIcfPvkHvnU/MkZXJyfei6QcFPVz/irQ70WtK0iT5RS3KRTDABw/vG0fiOl GSVQ6tukEFo+1GdvAmTleyUEN33SakLWYkZ0yioCpmKVaC45/vo3J6fOUKm1IZJhLOrz 8nMq2rwItvYNJLdfEj5W0nm/WjAMJkTRWZ1hhsfTSsTp++vFI41oQt5dSR4Ndz+LWANQ 0x6ubra7HFVhO8A12jDA6c1r8Pj7NI8J7y/CZwI7CapTb9BSWsTmy4oNH5kNT7dXNuzw keMg== X-Gm-Message-State: ANhLgQ3kkaymbyXNjV/ZyqpFGBAve6lTw2tnDsKLkBqgHn5HovGvToUT GIDKizlEQkS4/f43L89KtBxNag== X-Received: by 2002:adf:e911:: with SMTP id f17mr10602906wrm.87.1584019899241; Thu, 12 Mar 2020 06:31:39 -0700 (PDT) Received: from bender.baylibre.local (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id m21sm12242885wmi.27.2020.03.12.06.31.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 06:31:38 -0700 (PDT) From: Neil Armstrong To: broonie@kernel.org Cc: Neil Armstrong , linux-spi@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/9] spi: meson-spicc: add min sclk for each compatible Date: Thu, 12 Mar 2020 14:31:27 +0100 Message-Id: <20200312133131.26430-6-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20200312133131.26430-1-narmstrong@baylibre.com> References: <20200312133131.26430-1-narmstrong@baylibre.com> 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 G12A SPICC controller variant takes the source clock from a specific clock instead of the bus clock. The minimal clock calculus won't work with the G12A support, thus add the minimal supported clock for each variant and pass this to the SPI core. Signed-off-by: Neil Armstrong --- drivers/spi/spi-meson-spicc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-meson-spicc.c b/drivers/spi/spi-meson-spicc.c index 710b4e780daa..b5bd3a897e8f 100644 --- a/drivers/spi/spi-meson-spicc.c +++ b/drivers/spi/spi-meson-spicc.c @@ -132,6 +132,7 @@ struct meson_spicc_data { unsigned int max_speed_hz; + unsigned int min_speed_hz; bool has_oen; bool has_enhance_clk_div; }; @@ -685,7 +686,7 @@ static int meson_spicc_probe(struct platform_device *pdev) SPI_BPW_MASK(16) | SPI_BPW_MASK(8); master->flags = (SPI_MASTER_MUST_RX | SPI_MASTER_MUST_TX); - master->min_speed_hz = rate >> 9; + master->min_speed_hz = spicc->data->min_speed_hz; master->setup = meson_spicc_setup; master->cleanup = meson_spicc_cleanup; master->prepare_message = meson_spicc_prepare_message; @@ -736,10 +737,12 @@ static int meson_spicc_remove(struct platform_device *pdev) static const struct meson_spicc_data meson_spicc_gx_data = { .max_speed_hz = 30000000, + .min_speed_hz = 325000, }; static const struct meson_spicc_data meson_spicc_axg_data = { .max_speed_hz = 80000000, + .min_speed_hz = 325000, .has_oen = true, .has_enhance_clk_div = true, }; -- 2.22.0