- nvidia,maximum-dma-buffer-size: Maximum dma buffer size per transfer.
If this is not available then 16K will be default. The value should
be unit of byte.
-- nvidia,gpio-slave-ready: OUT GPIO from slave to report slave status. This
+- nvidia,slave-ready-gpio: OUT GPIO from slave to report slave status. This
GPIO, when asserted, implies slave controller is ready for transaction.
When this GPIO is de-asserted, the master cannot initiate transaction
with this slave.
-- nvidia,gpio-slave-ready-active-high: Set the slave ready GPIO polarity to
- active high.
Example:
spi@7000d600 {
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
- nvidia,gpio-slave-ready = <&gpio TEGRA_GPIO(I, 3) 0>; /*PI3*/
- nvidia,gpio-slave-ready-active-high;
+ nvidia,slave-ready-gpio = <&gpio TEGRA_GPIO(I, 3) GPIO_ACTIVE_LOW>; /*PI3*/
};
/* Slave Ready Polarity (true: Active High, false: Active Low) */
int gpio_slave_ready;
- bool slave_ready_pol;
+ bool slave_ready_active_high;
struct completion rx_dma_complete;
struct completion tx_dma_complete;
{
int deassert_val;
- if (tspi->slave_ready_pol)
+ if (tspi->slave_ready_active_high)
deassert_val = 0;
else
deassert_val = 1;
{
int assert_val;
- if (tspi->slave_ready_pol)
+ if (tspi->slave_ready_active_high)
assert_val = 1;
else
assert_val = 0;
struct tegra_spi_platform_data *pdata;
const unsigned int *prop;
struct device_node *np = pdev->dev.of_node;
+ enum of_gpio_flags gpio_flags;
u32 of_dma[2];
pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
pdata->is_clkon_always = true;
pdata->gpio_slave_ready =
- of_get_named_gpio(np, "nvidia,gpio-slave-ready", 0);
+ of_get_named_gpio_flags(np, "nvidia,slave-ready-gpio", 0,
+ &gpio_flags);
- /* Set the polarity to active low by default */
- pdata->slave_ready_pol = false;
-
- if (of_find_property(np, "nvidia,gpio-slave-ready-active-high", NULL))
- pdata->slave_ready_pol = true;
+ if (gpio_flags & OF_GPIO_ACTIVE_LOW)
+ pdata->slave_ready_active_high = false;
+ else
+ pdata->slave_ready_active_high = true;
return pdata;
}
tspi->gpio_slave_ready = -EINVAL;
}
- tspi->slave_ready_pol = pdata->slave_ready_pol;
+ tspi->slave_ready_active_high = pdata->slave_ready_active_high;
if (gpio_is_valid(tspi->gpio_slave_ready)) {
gpio_request(tspi->gpio_slave_ready, "gpio-spi-slave-ready");
- if (tspi->slave_ready_pol)
+ if (tspi->slave_ready_active_high)
deassert_val = 0;
else
deassert_val = 1;
/*
* spi-tegra.h: SPI interface for Nvidia slink/spi controller.
*
- * Copyright (c) 2011-2014, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2011-2015, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
int rx_trig_words;
int ls_bit;
int gpio_slave_ready;
- bool slave_ready_pol;
+ bool slave_ready_active_high;
int max_dma_buffer_size;
};