Albin Tonnerre | 2dc851e | 2009-08-20 16:04:49 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 |
| 3 | * Albin Tonnerre, Free Electrons <albin.tonnerre@free-electrons.com> |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Albin Tonnerre | 2dc851e | 2009-08-20 16:04:49 +0200 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | #include <asm/arch/hardware.h> |
| 10 | #include <asm/arch/at91_spi.h> |
| 11 | #include <asm/arch/gpio.h> |
| 12 | #include <spi.h> |
| 13 | |
| 14 | #define TNY_A9260_CS_PIN AT91_PIN_PC11 |
| 15 | |
| 16 | int spi_cs_is_valid(unsigned int bus, unsigned int cs) |
| 17 | { |
| 18 | return bus == 0 && cs == 1; |
| 19 | } |
| 20 | |
| 21 | void spi_cs_activate(struct spi_slave *slave) |
| 22 | { |
| 23 | at91_set_gpio_value(TNY_A9260_CS_PIN, 0); |
| 24 | } |
| 25 | |
| 26 | void spi_cs_deactivate(struct spi_slave *slave) |
| 27 | { |
| 28 | at91_set_gpio_value(TNY_A9260_CS_PIN, 1); |
| 29 | } |
| 30 | |
| 31 | void spi_init_f(void) |
| 32 | { |
| 33 | /* everything done in board_init */ |
| 34 | } |