From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UpYlZ-0004gB-Kc for barebox@lists.infradead.org; Thu, 20 Jun 2013 06:54:58 +0000 From: Sascha Hauer Date: Thu, 20 Jun 2013 08:54:17 +0200 Message-Id: <1371711261-10039-14-git-send-email-s.hauer@pengutronix.de> In-Reply-To: <1371711261-10039-1-git-send-email-s.hauer@pengutronix.de> References: <1371711261-10039-1-git-send-email-s.hauer@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 13/17] spi: mxs: Use clk support To: barebox@lists.infradead.org Cc: Juergen Beisert Signed-off-by: Sascha Hauer --- drivers/spi/mxs_spi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c index e15f2c2..8dfd6d5 100644 --- a/drivers/spi/mxs_spi.c +++ b/drivers/spi/mxs_spi.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -52,7 +53,7 @@ static inline struct mxs_spi *to_mxs(struct spi_master *master) static void imx_set_ssp_busclock(struct spi_master *master, uint32_t freq) { struct mxs_spi *mxs = to_mxs(master); - const uint32_t sspclk = imx_get_sspclk(master->bus_num); + const uint32_t sspclk = clk_get_rate(mxs->clk); uint32_t val; uint32_t divide, rate, tgtclk; @@ -266,6 +267,9 @@ static int mxs_spi_probe(struct device_d *dev) mxs->mode = SPI_CPOL | SPI_CPHA; mxs->regs = dev_request_mem_region(dev, 0); + mxs->clk = clk_get(dev, NULL); + if (IS_ERR(mxs->clk)) + return PTR_ERR(mxs->clk); spi_register_master(master); -- 1.8.3.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox