Skip to content

Commit

Permalink
spi: meson-spicc: support max 80MHz clock
Browse files Browse the repository at this point in the history
The SPICC controller in Meson-AXG is capable of running at 80M clock.
The ASIC IP is improved and the clock is actually running higher than
previous old SoCs.

Signed-off-by: Neil Armstrong <[email protected]>
Signed-off-by: Yixun Lan <[email protected]>
Signed-off-by: Sunny Luo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
superna9999 authored and broonie committed Mar 12, 2020
1 parent 3e0cf4d commit 3196816
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/spi/spi-meson-spicc.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
* to have a CS go down over the full transfer
*/

#define SPICC_MAX_FREQ 30000000
#define SPICC_MAX_BURST 128

/* Register Map */
Expand Down Expand Up @@ -132,6 +131,7 @@
#define SPICC_FIFO_HALF 10

struct meson_spicc_data {
unsigned int max_speed_hz;
bool has_oen;
bool has_enhance_clk_div;
};
Expand Down Expand Up @@ -693,11 +693,9 @@ static int meson_spicc_probe(struct platform_device *pdev)
master->transfer_one = meson_spicc_transfer_one;
master->use_gpio_descriptors = true;

/* Setup max rate according to the Meson GX datasheet */
if ((rate >> 2) > SPICC_MAX_FREQ)
master->max_speed_hz = SPICC_MAX_FREQ;
else
master->max_speed_hz = rate >> 2;
/* Setup max rate according to the Meson datasheet */
master->max_speed_hz = min_t(unsigned int, rate >> 1,
spicc->data->max_speed_hz);

meson_spicc_oen_enable(spicc);

Expand Down Expand Up @@ -737,9 +735,11 @@ static int meson_spicc_remove(struct platform_device *pdev)
}

static const struct meson_spicc_data meson_spicc_gx_data = {
.max_speed_hz = 30000000,
};

static const struct meson_spicc_data meson_spicc_axg_data = {
.max_speed_hz = 80000000,
.has_oen = true,
.has_enhance_clk_div = true,
};
Expand Down

0 comments on commit 3196816

Please sign in to comment.