* [PATCH v5 10/13] IIO: ADC: add stm32 DFSDM support for PDM microphone
From: Arnaud Pouliquen @ 2017-11-28 15:05 UTC (permalink / raw)
To: Rob Herring, Mark Rutland, Jonathan Cameron, Hartmut Knaack,
Lars-Peter Clausen, Peter Meerwald-Stadler, Jaroslav Kysela,
Takashi Iwai, Liam Girdwood, Mark Brown
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-iio-u79uwXL29TY76Z2rM5mHXA,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, Maxime Coquelin,
Alexandre Torgue, arnaud.pouliquen-qxv4g6HH51o
In-Reply-To: <1511881557-28596-1-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
This code offers a way to handle PDM audio microphones in
ASOC framework. Audio driver should use consumer API.
A specific management is implemented for DMA, with a
callback, to allows to handle audio buffers efficiently.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
---
V4 -> V5:
- Add devm_of_platform_populate to probe ASOC DAI device
- replace ext info "audio_sampling_rate" by IIO_CHAN_INFO_SAMP_FREQ attribute.
- Minor fixes based on Jonathan comments
.../ABI/testing/sysfs-bus-iio-dfsdm-adc-stm32 | 16 +
drivers/iio/adc/stm32-dfsdm-adc.c | 507 ++++++++++++++++++++-
include/linux/iio/adc/stm32-dfsdm-adc.h | 28 ++
3 files changed, 543 insertions(+), 8 deletions(-)
create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-dfsdm-adc-stm32
create mode 100644 include/linux/iio/adc/stm32-dfsdm-adc.h
diff --git a/Documentation/ABI/testing/sysfs-bus-iio-dfsdm-adc-stm32 b/Documentation/ABI/testing/sysfs-bus-iio-dfsdm-adc-stm32
new file mode 100644
index 0000000..da98223
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-iio-dfsdm-adc-stm32
@@ -0,0 +1,16 @@
+What: /sys/bus/iio/devices/iio:deviceX/in_voltage_spi_clk_freq
+KernelVersion: 4.14
+Contact: arnaud.pouliquen-qxv4g6HH51o@public.gmane.org
+Description:
+ For audio purpose only.
+ Used by audio driver to set/get the spi input frequency.
+ This is mandatory if DFSDM is slave on SPI bus, to
+ provide information on the SPI clock frequency during runtime
+ Notice that the SPI frequency should be a multiple of sample
+ frequency to ensure the precision.
+ if DFSDM input is SPI master
+ Reading SPI clkout frequency,
+ error on writing
+ If DFSDM input is SPI Slave:
+ Reading returns value previously set.
+ Writing value before starting conversions.
\ No newline at end of file
diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c
index f9419ab..80b0ca7 100644
--- a/drivers/iio/adc/stm32-dfsdm-adc.c
+++ b/drivers/iio/adc/stm32-dfsdm-adc.c
@@ -19,19 +19,25 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <linux/dmaengine.h>
+#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <linux/iio/buffer.h>
#include <linux/iio/hw-consumer.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
+#include <linux/iio/trigger_consumer.h>
+#include <linux/iio/triggered_buffer.h>
#include <linux/module.h>
-#include <linux/of.h>
+#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include "stm32-dfsdm.h"
+#define DFSDM_DMA_BUFFER_SIZE (4 * PAGE_SIZE)
+
/* Conversion timeout */
#define DFSDM_TIMEOUT_US 100000
#define DFSDM_TIMEOUT (msecs_to_jiffies(DFSDM_TIMEOUT_US / 1000))
@@ -71,6 +77,18 @@ struct stm32_dfsdm_adc {
struct completion completion;
u32 *buffer;
+ /* Audio specific */
+ unsigned int spi_freq; /* SPI bus clock frequency */
+ unsigned int sample_freq; /* Sample frequency after filter decimation */
+ int (*cb)(const void *data, size_t size, void *cb_priv);
+ void *cb_priv;
+
+ /* DMA */
+ u8 *rx_buf;
+ unsigned int bufi; /* Buffer current position */
+ unsigned int buf_sz; /* Buffer size */
+ struct dma_chan *dma_chan;
+ dma_addr_t dma_buf;
};
struct stm32_dfsdm_str2field {
@@ -364,10 +382,63 @@ int stm32_dfsdm_channel_parse_of(struct stm32_dfsdm *dfsdm,
return 0;
}
+static ssize_t dfsdm_adc_audio_get_spiclk(struct iio_dev *indio_dev,
+ uintptr_t priv,
+ const struct iio_chan_spec *chan,
+ char *buf)
+{
+ struct stm32_dfsdm_adc *adc = iio_priv(indio_dev);
+
+ return snprintf(buf, PAGE_SIZE, "%d\n", adc->spi_freq);
+}
+
+static ssize_t dfsdm_adc_audio_set_spiclk(struct iio_dev *indio_dev,
+ uintptr_t priv,
+ const struct iio_chan_spec *chan,
+ const char *buf, size_t len)
+{
+ struct stm32_dfsdm_adc *adc = iio_priv(indio_dev);
+ struct stm32_dfsdm_filter *fl = &adc->dfsdm->fl_list[adc->fl_id];
+ struct stm32_dfsdm_channel *ch = &adc->dfsdm->ch_list[adc->ch_id];
+ unsigned int sample_freq = adc->sample_freq;
+ unsigned int spi_freq;
+ int ret;
+
+ dev_err(&indio_dev->dev, "enter %s\n", __func__);
+ /* If DFSDM is master on SPI, SPI freq can not be updated */
+ if (ch->src != DFSDM_CHANNEL_SPI_CLOCK_EXTERNAL)
+ return -EPERM;
+
+ ret = kstrtoint(buf, 0, &spi_freq);
+ if (ret)
+ return ret;
+
+ if (!spi_freq)
+ return -EINVAL;
+
+ if (sample_freq) {
+ if (spi_freq % sample_freq)
+ dev_warn(&indio_dev->dev,
+ "Sampling rate not accurate (%d)\n",
+ spi_freq / (spi_freq / sample_freq));
+
+ ret = stm32_dfsdm_set_osrs(fl, 0, (spi_freq / sample_freq));
+ if (ret < 0) {
+ dev_err(&indio_dev->dev,
+ "No filter parameters that match!\n");
+ return ret;
+ }
+ }
+ adc->spi_freq = spi_freq;
+
+ return len;
+}
+
static int stm32_dfsdm_start_conv(struct stm32_dfsdm_adc *adc, bool dma)
{
struct regmap *regmap = adc->dfsdm->regmap;
int ret;
+ unsigned int dma_en = 0, cont_en = 0;
ret = stm32_dfsdm_start_channel(adc->dfsdm, adc->ch_id);
if (ret < 0)
@@ -378,6 +449,24 @@ static int stm32_dfsdm_start_conv(struct stm32_dfsdm_adc *adc, bool dma)
if (ret < 0)
goto stop_channels;
+ if (dma) {
+ /* Enable DMA transfer*/
+ dma_en = DFSDM_CR1_RDMAEN(1);
+ /* Enable conversion triggered by SPI clock*/
+ cont_en = DFSDM_CR1_RCONT(1);
+ }
+ /* Enable DMA transfer*/
+ ret = regmap_update_bits(regmap, DFSDM_CR1(adc->fl_id),
+ DFSDM_CR1_RDMAEN_MASK, dma_en);
+ if (ret < 0)
+ goto stop_channels;
+
+ /* Enable conversion triggered by SPI clock*/
+ ret = regmap_update_bits(regmap, DFSDM_CR1(adc->fl_id),
+ DFSDM_CR1_RCONT_MASK, cont_en);
+ if (ret < 0)
+ goto stop_channels;
+
ret = stm32_dfsdm_start_filter(adc->dfsdm, adc->fl_id);
if (ret < 0)
goto stop_channels;
@@ -411,6 +500,231 @@ static void stm32_dfsdm_stop_conv(struct stm32_dfsdm_adc *adc)
stm32_dfsdm_stop_channel(adc->dfsdm, adc->ch_id);
}
+static int stm32_dfsdm_set_watermark(struct iio_dev *indio_dev,
+ unsigned int val)
+{
+ struct stm32_dfsdm_adc *adc = iio_priv(indio_dev);
+ unsigned int watermark = DFSDM_DMA_BUFFER_SIZE / 2;
+
+ /*
+ * DMA cyclic transfers are used, buffer is split into two periods.
+ * There should be :
+ * - always one buffer (period) DMA is working on
+ * - one buffer (period) driver pushed to ASoC side.
+ */
+ watermark = min(watermark, val * (unsigned int)(sizeof(u32)));
+ adc->buf_sz = watermark * 2;
+
+ return 0;
+}
+
+static unsigned int stm32_dfsdm_adc_dma_residue(struct stm32_dfsdm_adc *adc)
+{
+ struct dma_tx_state state;
+ enum dma_status status;
+
+ status = dmaengine_tx_status(adc->dma_chan,
+ adc->dma_chan->cookie,
+ &state);
+ if (status == DMA_IN_PROGRESS) {
+ /* Residue is size in bytes from end of buffer */
+ unsigned int i = adc->buf_sz - state.residue;
+ unsigned int size;
+
+ /* Return available bytes */
+ if (i >= adc->bufi)
+ size = i - adc->bufi;
+ else
+ size = adc->buf_sz + i - adc->bufi;
+
+ return size;
+ }
+
+ return 0;
+}
+
+static void stm32_dfsdm_audio_dma_buffer_done(void *data)
+{
+ struct iio_dev *indio_dev = data;
+ struct stm32_dfsdm_adc *adc = iio_priv(indio_dev);
+ int available = stm32_dfsdm_adc_dma_residue(adc);
+ size_t old_pos;
+
+ /*
+ * FIXME: In Kernel interface does not support cyclic DMA buffer,and
+ * offers only an interface to push data samples per samples.
+ * For this reason IIO buffer interface is not used and interface is
+ * bypassed using a private callback registered by ASoC.
+ * This should be a temporary solution waiting a cyclic DMA engine
+ * support in IIO.
+ */
+
+ dev_dbg(&indio_dev->dev, "%s: pos = %d, available = %d\n", __func__,
+ adc->bufi, available);
+ old_pos = adc->bufi;
+
+ while (available >= indio_dev->scan_bytes) {
+ u32 *buffer = (u32 *)&adc->rx_buf[adc->bufi];
+
+ /* Mask 8 LSB that contains the channel ID */
+ *buffer = (*buffer & 0xFFFFFF00) << 8;
+ available -= indio_dev->scan_bytes;
+ adc->bufi += indio_dev->scan_bytes;
+ if (adc->bufi >= adc->buf_sz) {
+ if (adc->cb)
+ adc->cb(&adc->rx_buf[old_pos],
+ adc->buf_sz - old_pos, adc->cb_priv);
+ adc->bufi = 0;
+ old_pos = 0;
+ }
+ }
+ if (adc->cb)
+ adc->cb(&adc->rx_buf[old_pos], adc->bufi - old_pos,
+ adc->cb_priv);
+}
+
+static int stm32_dfsdm_adc_dma_start(struct iio_dev *indio_dev)
+{
+ struct stm32_dfsdm_adc *adc = iio_priv(indio_dev);
+ struct dma_async_tx_descriptor *desc;
+ dma_cookie_t cookie;
+ int ret;
+
+ if (!adc->dma_chan)
+ return -EINVAL;
+
+ dev_dbg(&indio_dev->dev, "%s size=%d watermark=%d\n", __func__,
+ adc->buf_sz, adc->buf_sz / 2);
+
+ /* Prepare a DMA cyclic transaction */
+ desc = dmaengine_prep_dma_cyclic(adc->dma_chan,
+ adc->dma_buf,
+ adc->buf_sz, adc->buf_sz / 2,
+ DMA_DEV_TO_MEM,
+ DMA_PREP_INTERRUPT);
+ if (!desc)
+ return -EBUSY;
+
+ desc->callback = stm32_dfsdm_audio_dma_buffer_done;
+ desc->callback_param = indio_dev;
+
+ cookie = dmaengine_submit(desc);
+ ret = dma_submit_error(cookie);
+ if (ret) {
+ dmaengine_terminate_all(adc->dma_chan);
+ return ret;
+ }
+
+ /* Issue pending DMA requests */
+ dma_async_issue_pending(adc->dma_chan);
+
+ return 0;
+}
+
+static int stm32_dfsdm_postenable(struct iio_dev *indio_dev)
+{
+ struct stm32_dfsdm_adc *adc = iio_priv(indio_dev);
+ int ret;
+
+ /* Reset adc buffer index */
+ adc->bufi = 0;
+
+ ret = stm32_dfsdm_start_dfsdm(adc->dfsdm);
+ if (ret < 0)
+ return ret;
+
+ ret = stm32_dfsdm_start_conv(adc, true);
+ if (ret) {
+ dev_err(&indio_dev->dev, "Can't start conversion\n");
+ goto stop_dfsdm;
+ }
+
+ if (adc->dma_chan) {
+ ret = stm32_dfsdm_adc_dma_start(indio_dev);
+ if (ret) {
+ dev_err(&indio_dev->dev, "Can't start DMA\n");
+ goto err_stop_conv;
+ }
+ }
+
+ return 0;
+
+err_stop_conv:
+ stm32_dfsdm_stop_conv(adc);
+stop_dfsdm:
+ stm32_dfsdm_stop_dfsdm(adc->dfsdm);
+
+ return ret;
+}
+
+static int stm32_dfsdm_predisable(struct iio_dev *indio_dev)
+{
+ struct stm32_dfsdm_adc *adc = iio_priv(indio_dev);
+
+ if (adc->dma_chan)
+ dmaengine_terminate_all(adc->dma_chan);
+
+ stm32_dfsdm_stop_conv(adc);
+
+ stm32_dfsdm_stop_dfsdm(adc->dfsdm);
+
+ return 0;
+}
+
+static const struct iio_buffer_setup_ops stm32_dfsdm_buffer_setup_ops = {
+ .postenable = &stm32_dfsdm_postenable,
+ .predisable = &stm32_dfsdm_predisable,
+};
+
+/**
+ * stm32_dfsdm_get_buff_cb() - register a callback that will be called when
+ * DMA transfer period is achieved.
+ *
+ * @iio_dev: Handle to IIO device.
+ * @cb: Pointer to callback function:
+ * - data: pointer to data buffer
+ * - size: size in byte of the data buffer
+ * - private: pointer to consumer private structure.
+ * @private: Pointer to consumer private structure.
+ */
+int stm32_dfsdm_get_buff_cb(struct iio_dev *iio_dev,
+ int (*cb)(const void *data, size_t size,
+ void *private),
+ void *private)
+{
+ struct stm32_dfsdm_adc *adc;
+
+ if (!iio_dev)
+ return -EINVAL;
+ adc = iio_priv(iio_dev);
+
+ adc->cb = cb;
+ adc->cb_priv = private;
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(stm32_dfsdm_get_buff_cb);
+
+/**
+ * stm32_dfsdm_release_buff_cb - unregister buffer callback
+ *
+ * @iio_dev: Handle to IIO device.
+ */
+int stm32_dfsdm_release_buff_cb(struct iio_dev *iio_dev)
+{
+ struct stm32_dfsdm_adc *adc;
+
+ if (!iio_dev)
+ return -EINVAL;
+ adc = iio_priv(iio_dev);
+
+ adc->cb = NULL;
+ adc->cb_priv = NULL;
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(stm32_dfsdm_release_buff_cb);
+
static int stm32_dfsdm_single_conv(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan, int *res)
{
@@ -466,15 +780,41 @@ static int stm32_dfsdm_write_raw(struct iio_dev *indio_dev,
{
struct stm32_dfsdm_adc *adc = iio_priv(indio_dev);
struct stm32_dfsdm_filter *fl = &adc->dfsdm->fl_list[adc->fl_id];
+ struct stm32_dfsdm_channel *ch = &adc->dfsdm->ch_list[adc->ch_id];
+ unsigned int spi_freq = adc->spi_freq;
int ret = -EINVAL;
- if (mask == IIO_CHAN_INFO_OVERSAMPLING_RATIO) {
+ switch (mask) {
+ case IIO_CHAN_INFO_OVERSAMPLING_RATIO:
ret = stm32_dfsdm_set_osrs(fl, 0, val);
if (!ret)
adc->oversamp = val;
+
+ return ret;
+
+ case IIO_CHAN_INFO_SAMP_FREQ:
+ if (!val)
+ return -EINVAL;
+ if (ch->src != DFSDM_CHANNEL_SPI_CLOCK_EXTERNAL)
+ spi_freq = adc->dfsdm->spi_master_freq;
+
+ if (spi_freq % val)
+ dev_warn(&indio_dev->dev,
+ "Sampling rate not accurate (%d)\n",
+ spi_freq / (spi_freq / val));
+
+ ret = stm32_dfsdm_set_osrs(fl, 0, (spi_freq / val));
+ if (ret < 0) {
+ dev_err(&indio_dev->dev,
+ "Not able to find parameter that match!\n");
+ return ret;
+ }
+ adc->sample_freq = val;
+
+ return 0;
}
- return ret;
+ return -EINVAL;
}
static int stm32_dfsdm_read_raw(struct iio_dev *indio_dev,
@@ -507,11 +847,22 @@ static int stm32_dfsdm_read_raw(struct iio_dev *indio_dev,
*val = adc->oversamp;
return IIO_VAL_INT;
+
+ case IIO_CHAN_INFO_SAMP_FREQ:
+ *val = adc->sample_freq;
+
+ return IIO_VAL_INT;
}
return -EINVAL;
}
+static const struct iio_info stm32_dfsdm_info_audio = {
+ .hwfifo_set_watermark = stm32_dfsdm_set_watermark,
+ .read_raw = stm32_dfsdm_read_raw,
+ .write_raw = stm32_dfsdm_write_raw,
+};
+
static const struct iio_info stm32_dfsdm_info_adc = {
.read_raw = stm32_dfsdm_read_raw,
.write_raw = stm32_dfsdm_write_raw,
@@ -544,6 +895,60 @@ static irqreturn_t stm32_dfsdm_irq(int irq, void *arg)
return IRQ_HANDLED;
}
+/*
+ * Define external info for SPI Frequency and audio sampling rate that can be
+ * configured by ASoC driver through consumer.h API
+ */
+static const struct iio_chan_spec_ext_info dfsdm_adc_audio_ext_info[] = {
+ /* spi_clk_freq : clock freq on SPI/manchester bus used by channel */
+ {
+ .name = "spi_clk_freq",
+ .shared = IIO_SHARED_BY_TYPE,
+ .read = dfsdm_adc_audio_get_spiclk,
+ .write = dfsdm_adc_audio_set_spiclk,
+ },
+ {},
+};
+
+static int stm32_dfsdm_dma_request(struct iio_dev *indio_dev)
+{
+ struct stm32_dfsdm_adc *adc = iio_priv(indio_dev);
+ struct dma_slave_config config;
+ int ret;
+
+ adc->dma_chan = dma_request_slave_channel(&indio_dev->dev, "rx");
+ if (!adc->dma_chan)
+ return -EINVAL;
+
+ adc->rx_buf = dma_alloc_coherent(adc->dma_chan->device->dev,
+ DFSDM_DMA_BUFFER_SIZE,
+ &adc->dma_buf, GFP_KERNEL);
+ if (!adc->rx_buf) {
+ ret = -ENOMEM;
+ goto err_release;
+ }
+
+ /* Configure DMA channel to read data register */
+ memset(&config, 0, sizeof(config));
+ config.src_addr = (dma_addr_t)adc->dfsdm->phys_base;
+ config.src_addr += DFSDM_RDATAR(adc->fl_id);
+ config.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
+
+ ret = dmaengine_slave_config(adc->dma_chan, &config);
+ if (ret)
+ goto err_free;
+
+ return 0;
+
+err_free:
+ dma_free_coherent(adc->dma_chan->device->dev, DFSDM_DMA_BUFFER_SIZE,
+ adc->rx_buf, adc->dma_buf);
+err_release:
+ dma_release_channel(adc->dma_chan);
+
+ return ret;
+}
+
static int stm32_dfsdm_adc_chan_init_one(struct iio_dev *indio_dev,
struct iio_chan_spec *ch)
{
@@ -564,7 +969,12 @@ static int stm32_dfsdm_adc_chan_init_one(struct iio_dev *indio_dev,
ch->info_mask_separate = BIT(IIO_CHAN_INFO_RAW);
ch->info_mask_shared_by_all = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO);
- ch->scan_type.sign = 'u';
+ if (adc->dev_data->type == DFSDM_AUDIO) {
+ ch->scan_type.sign = 's';
+ ch->ext_info = dfsdm_adc_audio_ext_info;
+ } else {
+ ch->scan_type.sign = 'u';
+ }
ch->scan_type.realbits = 24;
ch->scan_type.storagebits = 32;
adc->ch_id = ch->channel;
@@ -573,6 +983,64 @@ static int stm32_dfsdm_adc_chan_init_one(struct iio_dev *indio_dev,
&adc->dfsdm->ch_list[ch->channel]);
}
+static int stm32_dfsdm_audio_init(struct iio_dev *indio_dev)
+{
+ struct iio_chan_spec *ch;
+ struct stm32_dfsdm_adc *adc = iio_priv(indio_dev);
+ struct stm32_dfsdm_channel *d_ch;
+ int ret;
+
+ ret = stm32_dfsdm_dma_request(indio_dev);
+ if (ret) {
+ dev_err(&indio_dev->dev, "DMA request failed\n");
+ return ret;
+ }
+
+ indio_dev->modes |= INDIO_BUFFER_SOFTWARE;
+
+ ret = iio_triggered_buffer_setup(indio_dev,
+ &iio_pollfunc_store_time,
+ NULL,
+ &stm32_dfsdm_buffer_setup_ops);
+ if (ret) {
+ dev_err(&indio_dev->dev, "Buffer setup failed\n");
+ goto err_dma_disable;
+ }
+
+ ch = devm_kzalloc(&indio_dev->dev, sizeof(*ch), GFP_KERNEL);
+ if (!ch)
+ return -ENOMEM;
+
+ ch->scan_index = 0;
+ ret = stm32_dfsdm_adc_chan_init_one(indio_dev, ch);
+ if (ret < 0) {
+ dev_err(&indio_dev->dev, "channels init failed\n");
+ goto err_buffer_cleanup;
+ }
+ ch->info_mask_separate = BIT(IIO_CHAN_INFO_SAMP_FREQ);
+
+ d_ch = &adc->dfsdm->ch_list[adc->ch_id];
+ if (d_ch->src != DFSDM_CHANNEL_SPI_CLOCK_EXTERNAL)
+ adc->spi_freq = adc->dfsdm->spi_master_freq;
+
+ indio_dev->num_channels = 1;
+ indio_dev->channels = ch;
+
+ return 0;
+
+err_buffer_cleanup:
+ iio_triggered_buffer_cleanup(indio_dev);
+
+err_dma_disable:
+ if (adc->dma_chan) {
+ dma_free_coherent(adc->dma_chan->device->dev,
+ DFSDM_DMA_BUFFER_SIZE,
+ adc->rx_buf, adc->dma_buf);
+ dma_release_channel(adc->dma_chan);
+ }
+ return ret;
+}
+
static int stm32_dfsdm_adc_init(struct iio_dev *indio_dev)
{
struct iio_chan_spec *ch;
@@ -625,10 +1093,18 @@ static const struct stm32_dfsdm_dev_data stm32h7_dfsdm_adc_data = {
.init = stm32_dfsdm_adc_init,
};
+static const struct stm32_dfsdm_dev_data stm32h7_dfsdm_audio_data = {
+ .type = DFSDM_AUDIO,
+ .init = stm32_dfsdm_audio_init,
+};
+
static const struct of_device_id stm32_dfsdm_adc_match[] = {
{ .compatible = "st,stm32-dfsdm-adc",
.data = &stm32h7_dfsdm_adc_data,
},
+ { .compatible = "st,stm32-dfsdm-dmic",
+ .data = &stm32h7_dfsdm_audio_data,
+ },
{}
};
@@ -679,8 +1155,13 @@ static int stm32_dfsdm_adc_probe(struct platform_device *pdev)
name = devm_kzalloc(dev, sizeof("dfsdm-adc0"), GFP_KERNEL);
if (!name)
return -ENOMEM;
- iio->info = &stm32_dfsdm_info_adc;
- snprintf(name, sizeof("dfsdm-adc0"), "dfsdm-adc%d", adc->fl_id);
+ if (dev_data->type == DFSDM_AUDIO) {
+ iio->info = &stm32_dfsdm_info_audio;
+ snprintf(name, sizeof("dfsdm-pdm0"), "dfsdm-pdm%d", adc->fl_id);
+ } else {
+ iio->info = &stm32_dfsdm_info_adc;
+ snprintf(name, sizeof("dfsdm-adc0"), "dfsdm-adc%d", adc->fl_id);
+ }
iio->name = name;
/*
@@ -712,7 +1193,10 @@ static int stm32_dfsdm_adc_probe(struct platform_device *pdev)
if (ret < 0)
return ret;
- return iio_device_register(iio);
+ iio_device_register(iio);
+ if (dev_data->type == DFSDM_AUDIO)
+ return devm_of_platform_populate(&pdev->dev);
+ return 0;
}
static int stm32_dfsdm_adc_remove(struct platform_device *pdev)
@@ -721,7 +1205,14 @@ static int stm32_dfsdm_adc_remove(struct platform_device *pdev)
struct iio_dev *indio_dev = iio_priv_to_dev(adc);
iio_device_unregister(indio_dev);
-
+ if (indio_dev->pollfunc)
+ iio_triggered_buffer_cleanup(indio_dev);
+ if (adc->dma_chan) {
+ dma_free_coherent(adc->dma_chan->device->dev,
+ DFSDM_DMA_BUFFER_SIZE,
+ adc->rx_buf, adc->dma_buf);
+ dma_release_channel(adc->dma_chan);
+ }
return 0;
}
diff --git a/include/linux/iio/adc/stm32-dfsdm-adc.h b/include/linux/iio/adc/stm32-dfsdm-adc.h
new file mode 100644
index 0000000..cad7963
--- /dev/null
+++ b/include/linux/iio/adc/stm32-dfsdm-adc.h
@@ -0,0 +1,28 @@
+/*
+ * This file discribe the STM32 DFSDM IIO driver API for audio part
+ *
+ * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
+ * Author(s): Arnaud Pouliquen <arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>.
+ *
+ * License terms: GPL V2.0.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ */
+
+#ifndef STM32_DFSDM_ADC_H
+#define STM32_DFSDM_ADC_H
+
+int stm32_dfsdm_get_buff_cb(struct iio_dev *iio_dev,
+ int (*cb)(const void *data, size_t size,
+ void *private),
+ void *private);
+int stm32_dfsdm_release_buff_cb(struct iio_dev *iio_dev);
+
+#endif
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH v5 11/13] IIO: consumer: allow to set buffer sizes
From: Arnaud Pouliquen @ 2017-11-28 15:05 UTC (permalink / raw)
To: Rob Herring, Mark Rutland, Jonathan Cameron, Hartmut Knaack,
Lars-Peter Clausen, Peter Meerwald-Stadler, Jaroslav Kysela,
Takashi Iwai, Liam Girdwood, Mark Brown
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-iio-u79uwXL29TY76Z2rM5mHXA,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, Maxime Coquelin,
Alexandre Torgue, arnaud.pouliquen-qxv4g6HH51o
In-Reply-To: <1511881557-28596-1-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
Add iio consumer API to set buffer size and watermark according
to sysfs API.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
drivers/iio/buffer/industrialio-buffer-cb.c | 11 +++++++++++
include/linux/iio/consumer.h | 11 +++++++++++
2 files changed, 22 insertions(+)
diff --git a/drivers/iio/buffer/industrialio-buffer-cb.c b/drivers/iio/buffer/industrialio-buffer-cb.c
index 4847534..ea63c83 100644
--- a/drivers/iio/buffer/industrialio-buffer-cb.c
+++ b/drivers/iio/buffer/industrialio-buffer-cb.c
@@ -104,6 +104,17 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev,
}
EXPORT_SYMBOL_GPL(iio_channel_get_all_cb);
+int iio_channel_cb_set_buffer_watermark(struct iio_cb_buffer *cb_buff,
+ size_t watermark)
+{
+ if (!watermark)
+ return -EINVAL;
+ cb_buff->buffer.watermark = watermark;
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(iio_channel_cb_set_buffer_watermark);
+
int iio_channel_start_all_cb(struct iio_cb_buffer *cb_buff)
{
return iio_update_buffers(cb_buff->indio_dev, &cb_buff->buffer,
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
index 2017f35..9887f4f 100644
--- a/include/linux/iio/consumer.h
+++ b/include/linux/iio/consumer.h
@@ -134,6 +134,17 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev,
void *private),
void *private);
/**
+ * iio_channel_cb_set_buffer_watermark() - set the buffer watermark.
+ * @cb_buffer: The callback buffer from whom we want the channel
+ * information.
+ * @watermark: buffer watermark in bytes.
+ *
+ * This function allows to configure the buffer watermark.
+ */
+int iio_channel_cb_set_buffer_watermark(struct iio_cb_buffer *cb_buffer,
+ size_t watermark);
+
+/**
* iio_channel_release_all_cb() - release and unregister the callback.
* @cb_buffer: The callback buffer that was allocated.
*/
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH v5 12/13] ASoC: add bindings for stm32 DFSDM filter
From: Arnaud Pouliquen @ 2017-11-28 15:05 UTC (permalink / raw)
To: Rob Herring, Mark Rutland, Jonathan Cameron, Hartmut Knaack,
Lars-Peter Clausen, Peter Meerwald-Stadler, Jaroslav Kysela,
Takashi Iwai, Liam Girdwood, Mark Brown
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-iio-u79uwXL29TY76Z2rM5mHXA,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, Maxime Coquelin,
Alexandre Torgue, arnaud.pouliquen-qxv4g6HH51o
In-Reply-To: <1511881557-28596-1-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
Add bindings that describes audio settings to support
Digital Filter for pulse density modulation(PDM) microphone.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
---
.../devicetree/bindings/sound/st,stm32-adfsdm.txt | 62 ++++++++++++++++++++++
1 file changed, 62 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/st,stm32-adfsdm.txt
diff --git a/Documentation/devicetree/bindings/sound/st,stm32-adfsdm.txt b/Documentation/devicetree/bindings/sound/st,stm32-adfsdm.txt
new file mode 100644
index 0000000..2782cda
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/st,stm32-adfsdm.txt
@@ -0,0 +1,62 @@
+STMicroelectronics Audio Digital Filter Sigma Delta modulators(DFSDM)
+
+The DFSDM allows PDM microphones capture through SPI interface. The Audio
+interface is seems as a sub block of the DFSDM device.
+For details on DFSDM bindings refer to ../iio/adc/st,stm32-dfsdm-adc.txt
+
+Required properties:
+ - compatible: "st,stm32h7-dfsdm-dai".
+
+ - #sound-dai-cells : Must be equal to 0
+
+ - io-channels : phandle to iio dfsdm instance node.
+
+Example of a sound card using audio DFSDM node.
+
+ sound_card {
+ compatible = "audio-graph-card";
+
+ dais = <&cpu_port>;
+ };
+
+ dfsdm: dfsdm@40017000 {
+ compatible = "st,stm32h7-dfsdm";
+ reg = <0x40017000 0x400>;
+ clocks = <&rcc DFSDM1_CK>;
+ clock-names = "dfsdm";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ dfsdm_adc0: dfsdm-adc@0 {
+ compatible = "st,stm32-dfsdm-dmic";
+ reg = <0>;
+ interrupts = <110>;
+ dmas = <&dmamux1 101 0x400 0x00>;
+ dma-names = "rx";
+ st,adc-channels = <1>;
+ st,adc-channel-names = "dmic0";
+ st,adc-channel-types = "SPI_R";
+ st,adc-channel-clk-src = "CLKOUT";
+ st,filter-order = <5>;
+
+ dfsdm_dai0: dfsdm-dai {
+ compatible = "st,stm32h7-dfsdm-dai";
+ #sound-dai-cells = <0>;
+ io-channels = <&dfsdm_adc0 0>;
+ cpu_port: port {
+ dfsdm_endpoint: endpoint {
+ remote-endpoint = <&dmic0_endpoint>;
+ };
+ };
+ };
+ };
+
+ dmic0: dmic@0 {
+ compatible = "dmic-codec";
+ #sound-dai-cells = <0>;
+ port {
+ dmic0_endpoint: endpoint {
+ remote-endpoint = <&dfsdm_endpoint>;
+ };
+ };
+ };
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH v5 13/13] ASoC: stm32: add DFSDM DAI support
From: Arnaud Pouliquen @ 2017-11-28 15:05 UTC (permalink / raw)
To: Rob Herring, Mark Rutland, Jonathan Cameron, Hartmut Knaack,
Lars-Peter Clausen, Peter Meerwald-Stadler, Jaroslav Kysela,
Takashi Iwai, Liam Girdwood, Mark Brown
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-iio-u79uwXL29TY76Z2rM5mHXA,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, Maxime Coquelin,
Alexandre Torgue, arnaud.pouliquen-qxv4g6HH51o
In-Reply-To: <1511881557-28596-1-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
Add driver to handle DAI interface for PDM microphones connected
to Digital Filter for Sigma Delta Modulators IP.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
---
sound/soc/stm/Kconfig | 11 ++
sound/soc/stm/Makefile | 3 +
sound/soc/stm/stm32_adfsdm.c | 386 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 400 insertions(+)
create mode 100644 sound/soc/stm/stm32_adfsdm.c
diff --git a/sound/soc/stm/Kconfig b/sound/soc/stm/Kconfig
index 3398e6c..a78f770 100644
--- a/sound/soc/stm/Kconfig
+++ b/sound/soc/stm/Kconfig
@@ -28,4 +28,15 @@ config SND_SOC_STM32_SPDIFRX
help
Say Y if you want to enable S/PDIF capture for STM32
+config SND_SOC_STM32_DFSDM
+ tristate "SoC Audio support for STM32 DFSDM"
+ depends on (ARCH_STM32 && OF && STM32_DFSDM_ADC) || COMPILE_TEST
+ depends on SND_SOC
+ select SND_SOC_GENERIC_DMAENGINE_PCM
+ select SND_SOC_DMIC
+ select IIO_BUFFER_CB
+ help
+ Select this option to enable the STM32 Digital Filter
+ for Sigma Delta Modulators (DFSDM) driver used
+ in various STM32 series for digital microphone capture.
endmenu
diff --git a/sound/soc/stm/Makefile b/sound/soc/stm/Makefile
index 4ed22e6..53e90e6 100644
--- a/sound/soc/stm/Makefile
+++ b/sound/soc/stm/Makefile
@@ -12,3 +12,6 @@ obj-$(CONFIG_SND_SOC_STM32_I2S) += snd-soc-stm32-i2s.o
# SPDIFRX
snd-soc-stm32-spdifrx-objs := stm32_spdifrx.o
obj-$(CONFIG_SND_SOC_STM32_SPDIFRX) += snd-soc-stm32-spdifrx.o
+
+#DFSDM
+obj-$(CONFIG_SND_SOC_STM32_DFSDM) += stm32_adfsdm.o
diff --git a/sound/soc/stm/stm32_adfsdm.c b/sound/soc/stm/stm32_adfsdm.c
new file mode 100644
index 0000000..7502559
--- /dev/null
+++ b/sound/soc/stm/stm32_adfsdm.c
@@ -0,0 +1,386 @@
+/*
+ * This file is part of STM32 DFSDM ASoC DAI driver
+ *
+ * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
+ * Authors: Arnaud Pouliquen <arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
+ * Olivier Moysan <olivier.moysan-qxv4g6HH51o@public.gmane.org>
+ *
+ * License terms: GPL V2.0.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/clk.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+
+#include <linux/iio/iio.h>
+#include <linux/iio/consumer.h>
+#include <linux/iio/adc/stm32-dfsdm-adc.h>
+
+#include <sound/pcm.h>
+#include <sound/soc.h>
+
+#define STM32_ADFSDM_DRV_NAME "stm32-adfsdm"
+
+#define DFSDM_MAX_PERIOD_SIZE (PAGE_SIZE / 2)
+#define DFSDM_MAX_PERIODS 6
+
+struct stm32_adfsdm_priv {
+ struct snd_soc_dai_driver dai_drv;
+ struct snd_pcm_substream *substream;
+ struct device *dev;
+
+ /* IIO */
+ struct iio_channel *iio_ch;
+ struct iio_cb_buffer *iio_cb;
+ bool iio_active;
+
+ /* PCM buffer */
+ unsigned char *pcm_buff;
+ unsigned int pos;
+ bool allocated;
+};
+
+struct stm32_adfsdm_data {
+ unsigned int rate; /* SNDRV_PCM_RATE value */
+ unsigned int freq; /* frequency in Hz */
+};
+
+static const struct snd_pcm_hardware stm32_adfsdm_pcm_hw = {
+ .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
+ SNDRV_PCM_INFO_PAUSE,
+ .formats = SNDRV_PCM_FMTBIT_S32_LE,
+
+ .rate_min = 8000,
+ .rate_max = 32000,
+
+ .channels_min = 1,
+ .channels_max = 1,
+
+ .periods_min = 2,
+ .periods_max = DFSDM_MAX_PERIODS,
+
+ .period_bytes_max = DFSDM_MAX_PERIOD_SIZE,
+ .buffer_bytes_max = DFSDM_MAX_PERIODS * DFSDM_MAX_PERIOD_SIZE
+};
+
+static void stm32_adfsdm_shutdown(struct snd_pcm_substream *substream,
+ struct snd_soc_dai *dai)
+{
+ struct stm32_adfsdm_priv *priv = snd_soc_dai_get_drvdata(dai);
+
+ if (priv->iio_active) {
+ iio_channel_stop_all_cb(priv->iio_cb);
+ priv->iio_active = false;
+ }
+}
+
+static int stm32_adfsdm_dai_prepare(struct snd_pcm_substream *substream,
+ struct snd_soc_dai *dai)
+{
+ struct stm32_adfsdm_priv *priv = snd_soc_dai_get_drvdata(dai);
+ int ret;
+
+ ret = iio_write_channel_attribute(priv->iio_ch,
+ substream->runtime->rate, 0,
+ IIO_CHAN_INFO_SAMP_FREQ);
+ if (ret < 0) {
+ dev_err(dai->dev, "%s: Failed to set %d sampling rate\n",
+ __func__, substream->runtime->rate);
+ return ret;
+ }
+
+ if (!priv->iio_active) {
+ ret = iio_channel_start_all_cb(priv->iio_cb);
+ if (!ret)
+ priv->iio_active = true;
+ else
+ dev_err(dai->dev, "%s: IIO channel start failed (%d)\n",
+ __func__, ret);
+ }
+
+ return ret;
+}
+
+static int stm32_adfsdm_set_sysclk(struct snd_soc_dai *dai, int clk_id,
+ unsigned int freq, int dir)
+{
+ struct stm32_adfsdm_priv *priv = snd_soc_dai_get_drvdata(dai);
+ ssize_t size;
+
+ dev_dbg(dai->dev, "%s: Enter for freq %d\n", __func__, freq);
+
+ /* Set IIO frequency if CODEC is master as clock comes from SPI_IN*/
+ if (dir == SND_SOC_CLOCK_IN) {
+ char str_freq[10];
+
+ snprintf(str_freq, sizeof(str_freq), "%d\n", freq);
+ size = iio_write_channel_ext_info(priv->iio_ch, "spi_clk_freq",
+ str_freq, sizeof(str_freq));
+ if (size != sizeof(str_freq)) {
+ dev_err(dai->dev, "%s: Failed to set SPI clock\n",
+ __func__);
+ return -EINVAL;
+ }
+ }
+ return 0;
+}
+
+static const struct snd_soc_dai_ops stm32_adfsdm_dai_ops = {
+ .shutdown = stm32_adfsdm_shutdown,
+ .prepare = stm32_adfsdm_dai_prepare,
+ .set_sysclk = stm32_adfsdm_set_sysclk,
+};
+
+static const struct snd_soc_dai_driver stm32_adfsdm_dai = {
+ .capture = {
+ .channels_min = 1,
+ .channels_max = 1,
+ .formats = SNDRV_PCM_FMTBIT_S32_LE,
+ .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |
+ SNDRV_PCM_RATE_32000),
+ },
+ .ops = &stm32_adfsdm_dai_ops,
+};
+
+static const struct snd_soc_component_driver stm32_adfsdm_dai_component = {
+ .name = "stm32_dfsdm_audio",
+};
+
+static int stm32_afsdm_pcm_cb(const void *data, size_t size, void *private)
+{
+ struct stm32_adfsdm_priv *priv = private;
+ struct snd_soc_pcm_runtime *rtd = priv->substream->private_data;
+ u8 *pcm_buff = priv->pcm_buff;
+ u8 *src_buff = (u8 *)data;
+ unsigned int buff_size = snd_pcm_lib_buffer_bytes(priv->substream);
+ unsigned int period_size = snd_pcm_lib_period_bytes(priv->substream);
+ unsigned int old_pos = priv->pos;
+ unsigned int cur_size = size;
+
+ dev_dbg(rtd->dev, "%s: buff_add :%p, pos = %d, size = %d\n",
+ __func__, &pcm_buff[priv->pos], priv->pos, size);
+
+ if ((priv->pos + size) > buff_size) {
+ memcpy(&pcm_buff[priv->pos], src_buff, buff_size - priv->pos);
+ cur_size -= buff_size - priv->pos;
+ priv->pos = 0;
+ }
+
+ memcpy(&pcm_buff[priv->pos], &src_buff[size - cur_size], cur_size);
+ priv->pos = (priv->pos + cur_size) % buff_size;
+
+ if (cur_size != size || (old_pos && (old_pos % period_size < size)))
+ snd_pcm_period_elapsed(priv->substream);
+
+ return 0;
+}
+
+static int stm32_adfsdm_trigger(struct snd_pcm_substream *substream, int cmd)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct stm32_adfsdm_priv *priv =
+ snd_soc_dai_get_drvdata(rtd->cpu_dai);
+
+ switch (cmd) {
+ case SNDRV_PCM_TRIGGER_START:
+ case SNDRV_PCM_TRIGGER_RESUME:
+ priv->pos = 0;
+ return stm32_dfsdm_get_buff_cb(priv->iio_ch->indio_dev,
+ stm32_afsdm_pcm_cb, priv);
+ case SNDRV_PCM_TRIGGER_SUSPEND:
+ case SNDRV_PCM_TRIGGER_STOP:
+ return stm32_dfsdm_release_buff_cb(priv->iio_ch->indio_dev);
+ default:
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+static int stm32_adfsdm_pcm_open(struct snd_pcm_substream *substream)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct stm32_adfsdm_priv *priv = snd_soc_dai_get_drvdata(rtd->cpu_dai);
+ int ret;
+
+ ret = snd_soc_set_runtime_hwparams(substream, &stm32_adfsdm_pcm_hw);
+ if (!ret)
+ priv->substream = substream;
+
+ return ret;
+}
+
+static int stm32_adfsdm_pcm_close(struct snd_pcm_substream *substream)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct stm32_adfsdm_priv *priv =
+ snd_soc_dai_get_drvdata(rtd->cpu_dai);
+
+ snd_pcm_lib_free_pages(substream);
+ priv->substream = NULL;
+
+ return 0;
+}
+
+static snd_pcm_uframes_t stm32_adfsdm_pcm_pointer(
+ struct snd_pcm_substream *substream)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct stm32_adfsdm_priv *priv =
+ snd_soc_dai_get_drvdata(rtd->cpu_dai);
+
+ return bytes_to_frames(substream->runtime, priv->pos);
+}
+
+static int stm32_adfsdm_pcm_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct stm32_adfsdm_priv *priv =
+ snd_soc_dai_get_drvdata(rtd->cpu_dai);
+ int ret;
+
+ ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
+ if (ret < 0)
+ return ret;
+ priv->pcm_buff = substream->runtime->dma_area;
+
+ return iio_channel_cb_set_buffer_watermark(priv->iio_cb,
+ params_period_size(params));
+}
+
+static int stm32_adfsdm_pcm_hw_free(struct snd_pcm_substream *substream)
+{
+ snd_pcm_lib_free_pages(substream);
+
+ return 0;
+}
+
+static struct snd_pcm_ops stm32_adfsdm_pcm_ops = {
+ .open = stm32_adfsdm_pcm_open,
+ .close = stm32_adfsdm_pcm_close,
+ .hw_params = stm32_adfsdm_pcm_hw_params,
+ .hw_free = stm32_adfsdm_pcm_hw_free,
+ .trigger = stm32_adfsdm_trigger,
+ .pointer = stm32_adfsdm_pcm_pointer,
+};
+
+static int stm32_adfsdm_pcm_new(struct snd_soc_pcm_runtime *rtd)
+{
+ struct snd_pcm *pcm = rtd->pcm;
+ struct stm32_adfsdm_priv *priv =
+ snd_soc_dai_get_drvdata(rtd->cpu_dai);
+ unsigned int size = DFSDM_MAX_PERIODS * DFSDM_MAX_PERIOD_SIZE;
+ int ret;
+
+ /*
+ * FIXME :
+ * A platform as been registered per DAI.
+ * In soc_new_pcm function, pcm_new callback is called for each
+ * component of the sound card. So if n dai links are created this
+ * function is called n times.
+ */
+ if (priv->allocated)
+ return 0;
+
+ ret = snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
+ priv->dev, size, size);
+ if (!ret)
+ priv->allocated = true;
+
+ return ret;
+}
+
+static void stm32_adfsdm_pcm_free(struct snd_pcm *pcm)
+{
+ struct snd_pcm_substream *substream;
+ struct snd_soc_pcm_runtime *rtd;
+ struct stm32_adfsdm_priv *priv;
+
+ substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
+ if (substream) {
+ rtd = substream->private_data;
+ priv = snd_soc_dai_get_drvdata(rtd->cpu_dai);
+
+ snd_pcm_lib_preallocate_free_for_all(pcm);
+ priv->allocated = false;
+ }
+}
+
+static struct snd_soc_platform_driver stm32_adfsdm_soc_platform = {
+ .ops = &stm32_adfsdm_pcm_ops,
+ .pcm_new = stm32_adfsdm_pcm_new,
+ .pcm_free = stm32_adfsdm_pcm_free,
+};
+
+static const struct of_device_id stm32_adfsdm_of_match[] = {
+ {.compatible = "st,stm32h7-dfsdm-dai"},
+ {}
+};
+MODULE_DEVICE_TABLE(of, stm32_adfsdm_of_match);
+
+static int stm32_adfsdm_probe(struct platform_device *pdev)
+{
+ struct stm32_adfsdm_priv *priv;
+ int ret;
+
+ priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
+ if (!priv)
+ return -ENOMEM;
+
+ priv->dev = &pdev->dev;
+ priv->dai_drv = stm32_adfsdm_dai;
+
+ dev_set_drvdata(&pdev->dev, priv);
+
+ ret = devm_snd_soc_register_component(&pdev->dev,
+ &stm32_adfsdm_dai_component,
+ &priv->dai_drv, 1);
+ if (ret < 0)
+ return ret;
+
+ /* Associate iio channel */
+ priv->iio_ch = devm_iio_channel_get_all(&pdev->dev);
+ if (IS_ERR(priv->iio_ch))
+ return PTR_ERR(priv->iio_ch);
+
+ priv->iio_cb = iio_channel_get_all_cb(&pdev->dev, NULL, NULL);
+ if (IS_ERR(priv->iio_cb))
+ return PTR_ERR(priv->iio_ch);
+
+ ret = devm_snd_soc_register_platform(&pdev->dev,
+ &stm32_adfsdm_soc_platform);
+ if (ret < 0)
+ dev_err(&pdev->dev, "%s: Failed to register PCM platform\n",
+ __func__);
+
+ return ret;
+}
+
+static struct platform_driver stm32_adfsdm_driver = {
+ .driver = {
+ .name = STM32_ADFSDM_DRV_NAME,
+ .of_match_table = stm32_adfsdm_of_match,
+ },
+ .probe = stm32_adfsdm_probe,
+};
+
+module_platform_driver(stm32_adfsdm_driver);
+
+MODULE_DESCRIPTION("stm32 DFSDM DAI driver");
+MODULE_AUTHOR("Arnaud Pouliquen <arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:" STM32_ADFSDM_DRV_NAME);
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* Re: [PATCH v2 2/4] DTS: GTA04: fix panel compatibility string
From: Tony Lindgren @ 2017-11-28 15:10 UTC (permalink / raw)
To: H. Nikolaus Schaller
Cc: Thierry Reding, David Airlie, Rob Herring, Mark Rutland,
Benoît Cousson, Russell King, Tomi Valkeinen,
Bartlomiej Zolnierkiewicz, Laurent Pinchart, Julia Lawall,
Sean Paul, dri-devel, devicetree, linux-kernel, linux-omap,
linux-arm-kernel, linux-fbdev, letux-kernel, kernel
In-Reply-To: <C108B0B6-FED7-44DB-9A18-39E3BE93E586@goldelico.com>
* H. Nikolaus Schaller <hns@goldelico.com> [171128 15:04]:
> Hi Tony,
>
> > Am 28.11.2017 um 15:57 schrieb Tony Lindgren <tony@atomide.com>:
> >
> > * H. Nikolaus Schaller <hns@goldelico.com> [171116 08:53]:
> >> Vendor string is "tpo" and not "toppoly".
> >>
> >> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> >> ---
> >> arch/arm/boot/dts/omap3-gta04.dtsi | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/arch/arm/boot/dts/omap3-gta04.dtsi b/arch/arm/boot/dts/omap3-gta04.dtsi
> >> index 4504908c23fe..ec27ed67a22a 100644
> >> --- a/arch/arm/boot/dts/omap3-gta04.dtsi
> >> +++ b/arch/arm/boot/dts/omap3-gta04.dtsi
> >> @@ -86,7 +86,7 @@
> >>
> >> /* lcd panel */
> >> lcd: td028ttec1@0 {
> >> - compatible = "toppoly,td028ttec1";
> >> + compatible = "tpo,td028ttec1";
> >> reg = <0>;
> >> spi-max-frequency = <100000>;
> >> spi-cpol;
> >
> > Applying into omap-for-v4.15/fixes thanks. The other dts patch seems
> > like it can wait for v4.16 merge window.
>
> Hm. Not really. It needs the panel driver to match. So either both or
> none should be applied or it will break the panel from working.
>
> I am just 1-2 hours away from submitting a -v3 (rebased and tested
> on top of 4.15-rc1).
OK fine dropping both. Please update the description in both dts
patches to make it clear they are needed as a fix. Preferrably
with a proper fixes tag.
Having "We can remove the "omapdss," prefix" in the description sure
does not sounds like it's needed as a fix :)
Sounds like maybe these two should be just a single patch for
a proper fix?
Regards,
Tony
^ permalink raw reply
* Re: [RFC 1/2] of: overlay: add whitelist
From: Rob Herring @ 2017-11-28 15:15 UTC (permalink / raw)
To: Alan Tull
Cc: Frank Rowand, Pantelis Antoniou, Moritz Fischer, devicetree,
linux-kernel, linux-fpga
In-Reply-To: <1511816284-12145-2-git-send-email-atull@kernel.org>
On Mon, Nov 27, 2017 at 02:58:03PM -0600, Alan Tull wrote:
> Add simple whitelist. When an overlay is submitted, if any target in
> the overlay is not in the whitelist, the overlay is rejected. Drivers
> that support dynamic configuration can register their device node with:
>
> int of_add_whitelist_node(struct device_node *np)
>
> and remove themselves with:
>
> void of_remove_whitelist_node(struct device_node *np)
I think these should be named for what they do, not how it is
implemented.
>
> Signed-off-by: Alan Tull <atull@kernel.org>
> ---
> drivers/of/overlay.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> include/linux/of.h | 12 +++++++++
> 2 files changed, 85 insertions(+)
>
> diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
> index c150abb..5f952a1 100644
> --- a/drivers/of/overlay.c
> +++ b/drivers/of/overlay.c
> @@ -21,6 +21,7 @@
> #include <linux/slab.h>
> #include <linux/err.h>
> #include <linux/idr.h>
> +#include <linux/spinlock.h>
>
> #include "of_private.h"
>
> @@ -646,6 +647,74 @@ static void free_overlay_changeset(struct overlay_changeset *ovcs)
> kfree(ovcs);
> }
>
> +/* lock for adding/removing device nodes to the whitelist */
> +static spinlock_t whitelist_lock;
> +
> +static struct list_head whitelist_list = LIST_HEAD_INIT(whitelist_list);
> +
> +struct dt_overlay_whitelist {
> + struct device_node *np;
> + struct list_head node;
> +};
Can't we just add a flags bit in device_node.flags? That would be much
simpler.
> +
> +int of_add_whitelist_node(struct device_node *np)
> +{
> + unsigned long flags;
> + struct dt_overlay_whitelist *wln;
> +
> + wln = kzalloc(sizeof(*wln), GFP_KERNEL);
> + if (!wln)
> + return -ENOMEM;
> +
> + wln->np = np;
> +
> + spin_lock_irqsave(&whitelist_lock, flags);
> + list_add(&wln->node, &whitelist_list);
> + spin_unlock_irqrestore(&whitelist_lock, flags);
> +
> + return 0;
> +}
> +EXPORT_SYMBOL_GPL(of_add_whitelist_node);
> +
> +void of_remove_whitelist_node(struct device_node *np)
> +{
> + struct dt_overlay_whitelist *wln;
> + unsigned long flags;
> +
> + list_for_each_entry(wln, &whitelist_list, node) {
> + if (np == wln->np) {
> + spin_lock_irqsave(&whitelist_lock, flags);
> + list_del(&wln->node);
> + spin_unlock_irqrestore(&whitelist_lock, flags);
> + kfree(wln);
> + return;
> + }
> + }
> +}
> +EXPORT_SYMBOL_GPL(of_remove_whitelist_node);
> +
> +static int of_check_whitelist(struct overlay_changeset *ovcs)
> +{
> + struct dt_overlay_whitelist *wln;
> + struct device_node *target;
> + int i;
> +
> + for (i = 0; i < ovcs->count; i++) {
> + target = ovcs->fragments[i].target;
> + if (!of_node_cmp(target->name, "__symbols__"))
> + continue;
> +
> + list_for_each_entry(wln, &whitelist_list, node)
> + if (target == wln->np)
> + break;
> +
> + if (target != wln->np)
> + return -ENODEV;
> + }
> +
> + return 0;
> +}
> +
> /**
> * of_overlay_apply() - Create and apply an overlay changeset
> * @tree: Expanded overlay device tree
> @@ -717,6 +786,10 @@ int of_overlay_apply(struct device_node *tree, int *ovcs_id)
> if (ret)
> goto err_free_overlay_changeset;
>
> + ret = of_check_whitelist(ovcs);
> + if (ret)
> + goto err_free_overlay_changeset;
This will break you until the next patch and breaks any other users. I
think this is now just the unittest as tilcdc overlay is getting
removed.
You have to make this chunk the last patch in the series.
Rob
^ permalink raw reply
* Re: [PATCH 1/4] dt-bindings: pinctrl: add bindings for MediaTek MT7622 SoC
From: Rob Herring @ 2017-11-28 15:20 UTC (permalink / raw)
To: sean.wang
Cc: mark.rutland, linus.walleij, matthias.bgg, devicetree,
linux-mediatek, linux-arm-kernel, linux-gpio, linux-kernel
In-Reply-To: <6e88d5b34241b32206f95279117afad4bb3d8661.1511840374.git.sean.wang@mediatek.com>
On Tue, Nov 28, 2017 at 11:49:59AM +0800, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
>
> Add devicetree bindings for MediaTek MT7622 pinctrl driver.
>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
> .../devicetree/bindings/pinctrl/pinctrl-mt7622.txt | 330 +++++++++++++++++++++
> 1 file changed, 330 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt7622.txt
>
> diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt7622.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt7622.txt
> new file mode 100644
> index 0000000..ce86d45
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt7622.txt
> @@ -0,0 +1,330 @@
> +== MediaTek MT7622 pinctrl controller ==
> +
> +Required properties for the root node:
> + - compatible: Should be one of the following
> + "mediatek,mt7622-pinctrl" for MT7622 SoC
> + - reg: offset and length of the pinctrl space
> +
> + - gpio-controller: Marks the device node as a GPIO controller.
> + - #gpio-cells: Should be two. The first cell is the pin number and the
> + second is the GPIO flags.
> +
> +Please refer to pinctrl-bindings.txt in this directory for details of the
> +common pinctrl bindings used by client devices, including the meaning of the
> +phrase "pin configuration node".
> +
> +MT7622 pin configuration nodes act as a container for an arbitrary number of
> +subnodes. Each of these subnodes represents some desired configuration for a
> +pin, a group, or a list of pins or groups. This configuration can include the
> +mux function to select on those pin(s)/group(s), and various pin configuration
> +parameters, such as pull-up, slew rate, etc.
> +
> +We support 2 types of configuration nodes. Those nodes can be either pinmux
> +nodes or pinconf nodes. Each configuration node can consist of multiple nodes
> +describing the pinmux and pinconf options.
> +
> +The name of each subnode is no matter as long as it is unique; all subnodes
s/is no matter/doesn't matter/
> +should be enumerated and processed purely based on their content.
> +
> +== pinmux nodes content ==
> +
> +The following generic properties as defined in pinctrl-bindings.txt are valid
> +to specify in a pinmux subnode:
> +
> +Required properties are:
> + - groups: An array of strings. Each string contains the name of a group.
> + Valid values for these names are listed below.
> + - function: A string containing the name of the function to mux to the
> + group. Valid values for function names are listed below.
> +
> +== pinconf nodes content ==
> +
> +The following generic properties as defined in pinctrl-bindings.txt are valid
> +to specify in a pinconf subnode:
> +
> +Required properties are:
> + - pins: An array of strings. Each string contains the name of a pin.
> + Valid values for these names are listed below.
> + - groups: An array of strings. Each string contains the name of a group.
> + Valid values for these names are listed below.
> +
> +Optional properies are:
> + bias-disable, bias-pull, bias-pull-down, input-enable,
> + input-schmitt-enable, input-schmitt-disable, output-enable
> + output-low, output-high, drive-strength, slew-rate
> +
> + Valid arguments for 'slew-rate' are '0' and '1' to select between slow and
> + fast respectively.
> + Valid arguments for 'drive-strength', 4, 8, 12, or 16 in mA.
> +
> +The following specific properties as defined are valid to specify in a pinconf
> +subnode:
> +
> +Optional properties are:
> + - mediatek,tdsel: Valid arguments are from 0 to 15
> + - mediatek,rdsel: Valid arguments are from 0 to 63
What are these properties controlling?
> +
> +== Valid values for pins, function and groups on MT7622 ==
> +
> +Valid values for pins are:
> +pins can be referenced via the pin names as the below table shown and the
> +related physical number is also put ahead of those names which helps cross
> +references to pins between groups to know whether pins assignment conflict
> +happens among devices try to acquire those available pins.
> +
> + Pin #: Valid values for pins
> + -----------------------------
> + PIN 0: "GPIO_A"
> + PIN 1: "I2S1_IN"
> + PIN 2: "I2S1_OUT"
> + PIN 3: "I2S_BCLK"
> + PIN 4: "I2S_WS"
> + PIN 5: "I2S_MCLK"
> + PIN 6: "TXD0"
> + PIN 7: "RXD0"
> + PIN 8: "SPI_WP"
> + PIN 9: "SPI_HOLD"
> + PIN 10: "SPI_CLK"
> + PIN 11: "SPI_MOSI"
> + PIN 12: "SPI_MISO"
> + PIN 13: "SPI_CS"
> + PIN 14: "SPI_SDA"
> + PIN 15: "SPI_SCL"
> + PIN 16: "I2S2_IN"
> + PIN 17: "I2S3_IN"
> + PIN 18: "I2S4_IN"
> + PIN 19: "I2S2_OUT"
> + PIN 20: "I2S3_OUT"
> + PIN 21: "I2S4_OUT"
> + PIN 22: "GPIO_B"
> + PIN 23: "MDC"
> + PIN 24: "MDIO"
> + PIN 25: "G2_TXD0"
> + PIN 26: "G2_TXD1"
> + PIN 27: "G2_TXD2"
> + PIN 28: "G2_TXD3"
> + PIN 29: "G2_TXEN"
> + PIN 30: "G2_TXC"
> + PIN 31: "G2_RXD0"
> + PIN 32: "G2_RXD1"
> + PIN 33: "G2_RXD2"
> + PIN 34: "G2_RXD3"
> + PIN 35: "G2_RXDV"
> + PIN 36: "G2_RXC"
> + PIN 37: "NCEB"
> + PIN 38: "NWEB"
> + PIN 39: "NREB"
> + PIN 40: "NDL4"
> + PIN 41: "NDL5"
> + PIN 42: "NDL6"
> + PIN 43: "NDL7"
> + PIN 44: "NRB"
> + PIN 45: "NCLE"
> + PIN 46: "NALE"
> + PIN 47: "NDL0"
> + PIN 48: "NDL1"
> + PIN 49: "NDL2"
> + PIN 50: "NDL3"
> + PIN 51: "MDI_TP_P0"
> + PIN 52: "MDI_TN_P0"
> + PIN 53: "MDI_RP_P0"
> + PIN 54: "MDI_RN_P0"
> + PIN 55: "MDI_TP_P1"
> + PIN 56: "MDI_TN_P1"
> + PIN 57: "MDI_RP_P1"
> + PIN 58: "MDI_RN_P1"
> + PIN 59: "MDI_RP_P2"
> + PIN 60: "MDI_RN_P2"
> + PIN 61: "MDI_TP_P2"
> + PIN 62: "MDI_TN_P2"
> + PIN 63: "MDI_TP_P3"
> + PIN 64: "MDI_TN_P3"
> + PIN 65: "MDI_RP_P3"
> + PIN 66: "MDI_RN_P3"
> + PIN 67: "MDI_RP_P4"
> + PIN 68: "MDI_RN_P4"
> + PIN 69: "MDI_TP_P4"
> + PIN 70: "MDI_TN_P4"
> + PIN 71: "SPI2_CK"
> + PIN 72: "SPI2_DATA"
> + PIN 73: "SPIC1_CLK"
> + PIN 74: "SPIC1_MOSI"
> + PIN 75: "SPIC1_MISO"
> + PIN 76: "SPIC1_CS"
> + PIN 77: "GPIO_D"
> + PIN 78: "WATCHDOG"
> + PIN 79: "RTS3_N"
> + PIN 80: "CTS3_N"
> + PIN 81: "TXD3"
> + PIN 82: "RXD3"
> + PIN 83: "PERST0_N"
> + PIN 84: "PERST1_N"
> + PIN 85: "WLED_N"
> + PIN 86: "EPHY_LED0_N"
> + PIN 87: "AUXIN0"
> + PIN 88: "AUXIN1"
> + PIN 89: "AUXIN2"
> + PIN 90: "AUXIN3"
> + PIN 91: "TXD4"
> + PIN 92: "RXD4"
> + PIN 93: "RTS4_IN"
> + PIN 94: "CST4_IN"
> + PIN 95: "PWM1"
> + PIN 96: "PWM2"
> + PIN 97: "PWM3"
> + PIN 98: "PWM4"
> + PIN 99: "PWM5"
> + PIN 100: "PWM6"
> + PIN 101: "PWM7"
> + PIN 102: "GPIO_E"
> +
> +Valid values for function are:
> + "emmc", "eth", "i2c", "i2s", "ir", "led", "flash", "pcie",
> + "pwm", "sd", "spi", "tdm", "uart"
> +
> +Valid values for groups are:
> +additional data is put followingly with valid value allowing us to know which
> +applicable function and which relevant pins (in pin#) are able applied for that
> +group.
> +
> + Valid value function pins (in pin#)
> + -------------------------------------------------------------------------
> + "emmc" "emmc" 40, 41, 42, 43, 44, 45,
> + 47, 48, 49, 50
> + "esw" "eth" 59, 60, 61, 62, 63, 64,
> + 65, 66, 67, 68, 69, 70
> + "mdc_mdio" "eth" 23, 24
> + "gmac1" "eth" 59, 60, 61, 62, 63, 64,
> + 65, 66, 67, 68, 69, 70
> + "gmac2" "eth" 25, 26, 27, 28, 29, 30,
> + 31, 32, 33, 34, 35, 36
> + "i2c0" "i2c" 14, 15
> + "i2c1_0" "i2c" 55, 56
> + "i2c1_1" "i2c" 73, 74
> + "i2c1_2" "i2c" 87, 88
> + "i2c2_0" "i2c" 57, 58
> + "i2c2_1" "i2c" 75, 76
> + "i2c2_2" "i2c" 89, 90
> + "i2s_in_bclk_ws_mclk" "i2s" 3, 4, 5
> + "i2s1_in_data" "i2s" 1
> + "i2s2_in_data" "i2s" 16
> + "i2s3_in_data" "i2s" 17
> + "i2s4_in_data" "i2s" 18
> + "i2s_out_bclk_ws_mclk" "i2s" 3, 4, 5
> + "i2s1_out_data" "i2s" 2
> + "i2s2_out_data" "i2s" 19
> + "i2s3_out_data" "i2s" 20
> + "i2s4_out_data" "i2s" 21
> + "ir_0_tx" "ir" 16
> + "ir_1_tx" "ir" 59
> + "ir_2_tx" "ir" 99
> + "ir_0_rx" "ir" 17
> + "ir_1_rx" "ir" 60
> + "ir_2_rx" "ir" 100
> + "ephy0_led" "led" 86
> + "ephy1_led" "led" 91
> + "ephy2_led" "led" 92
> + "ephy3_led" "led" 93
> + "ephy4_led" "led" 94
> + "wled" "led" 85
> + "par_nand" "flash" 37, 38, 39, 40, 41, 42,
> + 43, 44, 45, 46, 47, 48,
> + 49, 50
> + "snfi" "flash" 8, 9, 10, 11, 12, 13
> + "spi_nor" "flash" 8, 9, 10, 11, 12, 13
> + "pcie0_0_waken_clkreq" "pcie" 14, 15
> + "pcie0_1_waken_clkreq" "pcie" 79, 80
> + "pcie1_0_waken_clkreq" "pcie" 14, 15
> + "pcie0_pad_perst" "pcie" 83
> + "pcie1_pad_perst" "pcie" 84
> + "pwm_ch1_0" "pwm" 51
> + "pwm_ch1_1" "pwm" 73
> + "pwm_ch1_2" "pwm" 95
> + "pwm_ch2_0" "pwm" 52
> + "pwm_ch2_1" "pwm" 74
> + "pwm_ch2_2" "pwm" 96
> + "pwm_ch3_0" "pwm" 53
> + "pwm_ch3_1" "pwm" 75
> + "pwm_ch3_2" "pwm" 97
> + "pwm_ch4_0" "pwm" 54
> + "pwm_ch4_1" "pwm" 67
> + "pwm_ch4_2" "pwm" 76
> + "pwm_ch4_3" "pwm" 98
> + "pwm_ch5_0" "pwm" 68
> + "pwm_ch5_1" "pwm" 77
> + "pwm_ch5_2" "pwm" 99
> + "pwm_ch6_0" "pwm" 69
> + "pwm_ch6_1" "pwm" 78
> + "pwm_ch6_2" "pwm" 81
> + "pwm_ch6_3" "pwm" 100
> + "pwm_ch7_0" "pwm" 70
> + "pwm_ch7_1" "pwm" 82
> + "pwm_ch7_2" "pwm" 101
Mixed space and tabs.
> + "sd_0" "sd" 16, 17, 18, 19, 20, 21
> + "sd_1" "sd" 25, 26, 27, 28, 29, 30
> + "spic0_0" "spi" 63, 64, 65, 66
> + "spic0_1" "spi" 79, 80, 81, 82
> + "spic1_0" "spi" 67, 68, 69, 70
> + "spic1_1" "spi" 73, 74, 75, 76
> + "tdm_0_out_mclk_bclk" "tdm" 8, 9, 10
> + "tdm_0_in_mclk_bclk_ws" "tdm" 11, 12, 13
> + "tdm_0_out_data" "tdm" 20
> + "tdm_0_in_data" "tdm" 21
> + "tdm_1_out_mclk_bclk" "tdm" 57, 58, 59
> + "tdm_1_in_mclk_bclk_ws" "tdm" 60, 61, 62
> + "tdm_1_out_data" "tdm" 55
> + "tdm_1_in_data" "tdm" 56
> + "uart0_0_tx_rx" "uart" 6, 7
> + "uart1_0_tx_rx" "uart" 55, 56
> + "uart1_0_rts_cts" "uart" 57, 58
> + "uart1_1_tx_rx" "uart" 73, 74
> + "uart1_1_rts_cts" "uart" 75, 76
> + "uart2_0_tx_rx" "uart" 3, 4
> + "uart2_0_rts_cts" "uart" 1, 2
> + "uart2_1_tx_rx" "uart" 51, 52
> + "uart2_1_rts_cts" "uart" 53, 54
> + "uart2_2_tx_rx" "uart" 59, 60
> + "uart2_2_rts_cts" "uart" 61, 62
> + "uart2_3_tx_rx" "uart" 95, 96
> + "uart3_0_tx_rx" "uart" 57, 58
> + "uart3_1_tx_rx" "uart" 81, 82
> + "uart3_1_rts_cts" "uart" 79, 80
> + "uart4_0_tx_rx" "uart" 61, 62
> + "uart4_1_tx_rx" "uart" 91, 92
> + "uart4_1_rts_cts" "uart" 93, 94
> + "uart4_2_tx_rx" "uart" 97, 98
> + "uart4_2_rts_cts" "uart" 95, 96
> +
> +Example:
> +
> + pio: pinctrl@10211000 {
> + compatible = "mediatek,mt7622-pinctrl";
> + reg = <0 0x10211000 0 0x1000>;
> + gpio-controller;
> + #gpio-cells = <2>;
> +
> + pinctrl_eth_default: eth-default {
> + mux_mdio {
s/_/-/
> + groups = "mdc_mdio";
> + function = "eth";
> + drive-strength = <12>;
> + };
> +
> + mux_gmac2 {
ditto
> + groups = "gmac2";
> + function = "eth";
> + drive-strength = <12>;
> + };
> +
> + mux_esw {
> + groups = "esw";
> + function = "eth";
> + drive-strength = <8>;
> + };
> +
> + conf_mdio {
> + pins = "MDC";
> + bias-pull-up;
> + };
> + };
> + };
> --
> 2.7.4
>
^ permalink raw reply
* Re: [PATCH 04/11] dt-bindings: clock: qcom: add remaining clocks for IPQ8074
From: Abhishek Sahu @ 2017-11-28 15:24 UTC (permalink / raw)
To: Stephen Boyd, Michael Turquette, Rob Herring
Cc: Andy Gross, David Brown, linux-arm-msm, linux-soc, linux-clk,
linux-kernel, Mark Rutland, devicetree
In-Reply-To: <1506428644-2996-5-git-send-email-absahu@codeaurora.org>
On 2017-09-26 17:53, Abhishek Sahu wrote:
> This patch adds the DT bindings for following IPQ8074 clocks
>
> - General PLL’s, NSS UBI PLL and NSS Crypto PLL.
> - 2 instances of PCIE, USB, SDCC.
> - 2 NSS UBI core and common NSS clocks. NSS is network switching
> system which accelerates the ethernet traffic. IPQ8074
> NSS has two UBI cores. Some clocks are separate for each UBI core
> and remaining NSS clocks are common.
> - NSS ethernet port clocks. IPQ8074 has 6 ethernet ports and
> each port uses different TX and RX clocks.
> - Crypto engine clocks.
> - General purpose clocks which comes over GPIO.
>
Hi Rob,
Could you please review this DT bindings change and give
your Acked-by if its OK.
Thanks,
Abhishek
> Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
> ---
> include/dt-bindings/clock/qcom,gcc-ipq8074.h | 180
> +++++++++++++++++++++++++++
> 1 file changed, 180 insertions(+)
>
> diff --git a/include/dt-bindings/clock/qcom,gcc-ipq8074.h
> b/include/dt-bindings/clock/qcom,gcc-ipq8074.h
> index 370c83c..ff0b4ac 100644
> --- a/include/dt-bindings/clock/qcom,gcc-ipq8074.h
> +++ b/include/dt-bindings/clock/qcom,gcc-ipq8074.h
> @@ -58,6 +58,186 @@
> #define GCC_QPIC_AHB_CLK 41
> #define GCC_QPIC_CLK 42
> #define PCNOC_BFDCD_CLK_SRC 43
> +#define GPLL2_MAIN 44
> +#define GPLL2 45
> +#define GPLL4_MAIN 46
> +#define GPLL4 47
> +#define GPLL6_MAIN 48
> +#define GPLL6 49
> +#define UBI32_PLL_MAIN 50
> +#define UBI32_PLL 51
> +#define NSS_CRYPTO_PLL_MAIN 52
> +#define NSS_CRYPTO_PLL 53
> +#define PCIE0_AXI_CLK_SRC 54
> +#define PCIE0_AUX_CLK_SRC 55
> +#define PCIE0_PIPE_CLK_SRC 56
> +#define PCIE1_AXI_CLK_SRC 57
> +#define PCIE1_AUX_CLK_SRC 58
> +#define PCIE1_PIPE_CLK_SRC 59
> +#define SDCC1_APPS_CLK_SRC 60
> +#define SDCC1_ICE_CORE_CLK_SRC 61
> +#define SDCC2_APPS_CLK_SRC 62
> +#define USB0_MASTER_CLK_SRC 63
> +#define USB0_AUX_CLK_SRC 64
> +#define USB0_MOCK_UTMI_CLK_SRC 65
> +#define USB0_PIPE_CLK_SRC 66
> +#define USB1_MASTER_CLK_SRC 67
> +#define USB1_AUX_CLK_SRC 68
> +#define USB1_MOCK_UTMI_CLK_SRC 69
> +#define USB1_PIPE_CLK_SRC 70
> +#define GCC_XO_CLK_SRC 71
> +#define SYSTEM_NOC_BFDCD_CLK_SRC 72
> +#define NSS_CE_CLK_SRC 73
> +#define NSS_NOC_BFDCD_CLK_SRC 74
> +#define NSS_CRYPTO_CLK_SRC 75
> +#define NSS_UBI0_CLK_SRC 76
> +#define NSS_UBI0_DIV_CLK_SRC 77
> +#define NSS_UBI1_CLK_SRC 78
> +#define NSS_UBI1_DIV_CLK_SRC 79
> +#define UBI_MPT_CLK_SRC 80
> +#define NSS_IMEM_CLK_SRC 81
> +#define NSS_PPE_CLK_SRC 82
> +#define NSS_PORT1_RX_CLK_SRC 83
> +#define NSS_PORT1_RX_DIV_CLK_SRC 84
> +#define NSS_PORT1_TX_CLK_SRC 85
> +#define NSS_PORT1_TX_DIV_CLK_SRC 86
> +#define NSS_PORT2_RX_CLK_SRC 87
> +#define NSS_PORT2_RX_DIV_CLK_SRC 88
> +#define NSS_PORT2_TX_CLK_SRC 89
> +#define NSS_PORT2_TX_DIV_CLK_SRC 90
> +#define NSS_PORT3_RX_CLK_SRC 91
> +#define NSS_PORT3_RX_DIV_CLK_SRC 92
> +#define NSS_PORT3_TX_CLK_SRC 93
> +#define NSS_PORT3_TX_DIV_CLK_SRC 94
> +#define NSS_PORT4_RX_CLK_SRC 95
> +#define NSS_PORT4_RX_DIV_CLK_SRC 96
> +#define NSS_PORT4_TX_CLK_SRC 97
> +#define NSS_PORT4_TX_DIV_CLK_SRC 98
> +#define NSS_PORT5_RX_CLK_SRC 99
> +#define NSS_PORT5_RX_DIV_CLK_SRC 100
> +#define NSS_PORT5_TX_CLK_SRC 101
> +#define NSS_PORT5_TX_DIV_CLK_SRC 102
> +#define NSS_PORT6_RX_CLK_SRC 103
> +#define NSS_PORT6_RX_DIV_CLK_SRC 104
> +#define NSS_PORT6_TX_CLK_SRC 105
> +#define NSS_PORT6_TX_DIV_CLK_SRC 106
> +#define CRYPTO_CLK_SRC 107
> +#define GP1_CLK_SRC 108
> +#define GP2_CLK_SRC 109
> +#define GP3_CLK_SRC 110
> +#define GCC_PCIE0_AHB_CLK 111
> +#define GCC_PCIE0_AUX_CLK 112
> +#define GCC_PCIE0_AXI_M_CLK 113
> +#define GCC_PCIE0_AXI_S_CLK 114
> +#define GCC_PCIE0_PIPE_CLK 115
> +#define GCC_SYS_NOC_PCIE0_AXI_CLK 116
> +#define GCC_PCIE1_AHB_CLK 117
> +#define GCC_PCIE1_AUX_CLK 118
> +#define GCC_PCIE1_AXI_M_CLK 119
> +#define GCC_PCIE1_AXI_S_CLK 120
> +#define GCC_PCIE1_PIPE_CLK 121
> +#define GCC_SYS_NOC_PCIE1_AXI_CLK 122
> +#define GCC_USB0_AUX_CLK 123
> +#define GCC_SYS_NOC_USB0_AXI_CLK 124
> +#define GCC_USB0_MASTER_CLK 125
> +#define GCC_USB0_MOCK_UTMI_CLK 126
> +#define GCC_USB0_PHY_CFG_AHB_CLK 127
> +#define GCC_USB0_PIPE_CLK 128
> +#define GCC_USB0_SLEEP_CLK 129
> +#define GCC_USB1_AUX_CLK 130
> +#define GCC_SYS_NOC_USB1_AXI_CLK 131
> +#define GCC_USB1_MASTER_CLK 132
> +#define GCC_USB1_MOCK_UTMI_CLK 133
> +#define GCC_USB1_PHY_CFG_AHB_CLK 134
> +#define GCC_USB1_PIPE_CLK 135
> +#define GCC_USB1_SLEEP_CLK 136
> +#define GCC_SDCC1_AHB_CLK 137
> +#define GCC_SDCC1_APPS_CLK 138
> +#define GCC_SDCC1_ICE_CORE_CLK 139
> +#define GCC_SDCC2_AHB_CLK 140
> +#define GCC_SDCC2_APPS_CLK 141
> +#define GCC_MEM_NOC_NSS_AXI_CLK 142
> +#define GCC_NSS_CE_APB_CLK 143
> +#define GCC_NSS_CE_AXI_CLK 144
> +#define GCC_NSS_CFG_CLK 145
> +#define GCC_NSS_CRYPTO_CLK 146
> +#define GCC_NSS_CSR_CLK 147
> +#define GCC_NSS_EDMA_CFG_CLK 148
> +#define GCC_NSS_EDMA_CLK 149
> +#define GCC_NSS_IMEM_CLK 150
> +#define GCC_NSS_NOC_CLK 151
> +#define GCC_NSS_PPE_BTQ_CLK 152
> +#define GCC_NSS_PPE_CFG_CLK 153
> +#define GCC_NSS_PPE_CLK 154
> +#define GCC_NSS_PPE_IPE_CLK 155
> +#define GCC_NSS_PTP_REF_CLK 156
> +#define GCC_NSSNOC_CE_APB_CLK 157
> +#define GCC_NSSNOC_CE_AXI_CLK 158
> +#define GCC_NSSNOC_CRYPTO_CLK 159
> +#define GCC_NSSNOC_PPE_CFG_CLK 160
> +#define GCC_NSSNOC_PPE_CLK 161
> +#define GCC_NSSNOC_QOSGEN_REF_CLK 162
> +#define GCC_NSSNOC_SNOC_CLK 163
> +#define GCC_NSSNOC_TIMEOUT_REF_CLK 164
> +#define GCC_NSSNOC_UBI0_AHB_CLK 165
> +#define GCC_NSSNOC_UBI1_AHB_CLK 166
> +#define GCC_UBI0_AHB_CLK 167
> +#define GCC_UBI0_AXI_CLK 168
> +#define GCC_UBI0_NC_AXI_CLK 169
> +#define GCC_UBI0_CORE_CLK 170
> +#define GCC_UBI0_MPT_CLK 171
> +#define GCC_UBI1_AHB_CLK 172
> +#define GCC_UBI1_AXI_CLK 173
> +#define GCC_UBI1_NC_AXI_CLK 174
> +#define GCC_UBI1_CORE_CLK 175
> +#define GCC_UBI1_MPT_CLK 176
> +#define GCC_CMN_12GPLL_AHB_CLK 177
> +#define GCC_CMN_12GPLL_SYS_CLK 178
> +#define GCC_MDIO_AHB_CLK 179
> +#define GCC_UNIPHY0_AHB_CLK 180
> +#define GCC_UNIPHY0_SYS_CLK 181
> +#define GCC_UNIPHY1_AHB_CLK 182
> +#define GCC_UNIPHY1_SYS_CLK 183
> +#define GCC_UNIPHY2_AHB_CLK 184
> +#define GCC_UNIPHY2_SYS_CLK 185
> +#define GCC_NSS_PORT1_RX_CLK 186
> +#define GCC_NSS_PORT1_TX_CLK 187
> +#define GCC_NSS_PORT2_RX_CLK 188
> +#define GCC_NSS_PORT2_TX_CLK 189
> +#define GCC_NSS_PORT3_RX_CLK 190
> +#define GCC_NSS_PORT3_TX_CLK 191
> +#define GCC_NSS_PORT4_RX_CLK 192
> +#define GCC_NSS_PORT4_TX_CLK 193
> +#define GCC_NSS_PORT5_RX_CLK 194
> +#define GCC_NSS_PORT5_TX_CLK 195
> +#define GCC_NSS_PORT6_RX_CLK 196
> +#define GCC_NSS_PORT6_TX_CLK 197
> +#define GCC_PORT1_MAC_CLK 198
> +#define GCC_PORT2_MAC_CLK 199
> +#define GCC_PORT3_MAC_CLK 200
> +#define GCC_PORT4_MAC_CLK 201
> +#define GCC_PORT5_MAC_CLK 202
> +#define GCC_PORT6_MAC_CLK 203
> +#define GCC_UNIPHY0_PORT1_RX_CLK 204
> +#define GCC_UNIPHY0_PORT1_TX_CLK 205
> +#define GCC_UNIPHY0_PORT2_RX_CLK 206
> +#define GCC_UNIPHY0_PORT2_TX_CLK 207
> +#define GCC_UNIPHY0_PORT3_RX_CLK 208
> +#define GCC_UNIPHY0_PORT3_TX_CLK 209
> +#define GCC_UNIPHY0_PORT4_RX_CLK 210
> +#define GCC_UNIPHY0_PORT4_TX_CLK 211
> +#define GCC_UNIPHY0_PORT5_RX_CLK 212
> +#define GCC_UNIPHY0_PORT5_TX_CLK 213
> +#define GCC_UNIPHY1_PORT5_RX_CLK 214
> +#define GCC_UNIPHY1_PORT5_TX_CLK 215
> +#define GCC_UNIPHY2_PORT6_RX_CLK 216
> +#define GCC_UNIPHY2_PORT6_TX_CLK 217
> +#define GCC_CRYPTO_AHB_CLK 218
> +#define GCC_CRYPTO_AXI_CLK 219
> +#define GCC_CRYPTO_CLK 220
> +#define GCC_GP1_CLK 221
> +#define GCC_GP2_CLK 222
> +#define GCC_GP3_CLK 223
>
> #define GCC_BLSP1_BCR 0
> #define GCC_BLSP1_QUP1_BCR 1
^ permalink raw reply
* Re: [PATCH 10/11] dt-bindings: clock: qcom: add misc resets for PCIE and NSS
From: Abhishek Sahu @ 2017-11-28 15:25 UTC (permalink / raw)
To: Stephen Boyd, Michael Turquette, Rob Herring
Cc: Andy Gross, David Brown, linux-arm-msm, linux-soc, linux-clk,
linux-kernel, Mark Rutland, devicetree
In-Reply-To: <1506428644-2996-11-git-send-email-absahu@codeaurora.org>
On 2017-09-26 17:54, Abhishek Sahu wrote:
> PCIE and NSS has MISC reset register in which single register has
> multiple reset bit. The patch adds the DT bindings for these MISC
> resets.
>
> Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
Hi Rob,
Could you please review this DT bindings change and give
your Acked-by if its OK.
Thanks,
Abhishek
> ---
> include/dt-bindings/clock/qcom,gcc-ipq8074.h | 42
> ++++++++++++++++++++++++++++
> 1 file changed, 42 insertions(+)
>
> diff --git a/include/dt-bindings/clock/qcom,gcc-ipq8074.h
> b/include/dt-bindings/clock/qcom,gcc-ipq8074.h
> index ff0b4ac..238f872 100644
> --- a/include/dt-bindings/clock/qcom,gcc-ipq8074.h
> +++ b/include/dt-bindings/clock/qcom,gcc-ipq8074.h
> @@ -328,5 +328,47 @@
> #define GCC_APC0_VOLTAGE_DROOP_DETECTOR_BCR 86
> #define GCC_APC1_VOLTAGE_DROOP_DETECTOR_BCR 87
> #define GCC_SMMU_CATS_BCR 88
> +#define GCC_UBI0_AXI_ARES 89
> +#define GCC_UBI0_AHB_ARES 90
> +#define GCC_UBI0_NC_AXI_ARES 91
> +#define GCC_UBI0_DBG_ARES 92
> +#define GCC_UBI0_CORE_CLAMP_ENABLE 93
> +#define GCC_UBI0_CLKRST_CLAMP_ENABLE 94
> +#define GCC_UBI1_AXI_ARES 95
> +#define GCC_UBI1_AHB_ARES 96
> +#define GCC_UBI1_NC_AXI_ARES 97
> +#define GCC_UBI1_DBG_ARES 98
> +#define GCC_UBI1_CORE_CLAMP_ENABLE 99
> +#define GCC_UBI1_CLKRST_CLAMP_ENABLE 100
> +#define GCC_NSS_CFG_ARES 101
> +#define GCC_NSS_IMEM_ARES 102
> +#define GCC_NSS_NOC_ARES 103
> +#define GCC_NSS_CRYPTO_ARES 104
> +#define GCC_NSS_CSR_ARES 105
> +#define GCC_NSS_CE_APB_ARES 106
> +#define GCC_NSS_CE_AXI_ARES 107
> +#define GCC_NSSNOC_CE_APB_ARES 108
> +#define GCC_NSSNOC_CE_AXI_ARES 109
> +#define GCC_NSSNOC_UBI0_AHB_ARES 110
> +#define GCC_NSSNOC_UBI1_AHB_ARES 111
> +#define GCC_NSSNOC_SNOC_ARES 112
> +#define GCC_NSSNOC_CRYPTO_ARES 113
> +#define GCC_NSSNOC_ATB_ARES 114
> +#define GCC_NSSNOC_QOSGEN_REF_ARES 115
> +#define GCC_NSSNOC_TIMEOUT_REF_ARES 116
> +#define GCC_PCIE0_PIPE_ARES 117
> +#define GCC_PCIE0_SLEEP_ARES 118
> +#define GCC_PCIE0_CORE_STICKY_ARES 119
> +#define GCC_PCIE0_AXI_MASTER_ARES 120
> +#define GCC_PCIE0_AXI_SLAVE_ARES 121
> +#define GCC_PCIE0_AHB_ARES 122
> +#define GCC_PCIE0_AXI_MASTER_STICKY_ARES 123
> +#define GCC_PCIE1_PIPE_ARES 124
> +#define GCC_PCIE1_SLEEP_ARES 125
> +#define GCC_PCIE1_CORE_STICKY_ARES 126
> +#define GCC_PCIE1_AXI_MASTER_ARES 127
> +#define GCC_PCIE1_AXI_SLAVE_ARES 128
> +#define GCC_PCIE1_AHB_ARES 129
> +#define GCC_PCIE1_AXI_MASTER_STICKY_ARES 130
>
> #endif
^ permalink raw reply
* Re: [PATCH] dt-bindings: uniphier: add bindings for UniPhier SoC family
From: Rob Herring @ 2017-11-28 15:25 UTC (permalink / raw)
To: Masahiro Yamada
Cc: devicetree, Andreas Färber, Mauro Carvalho Chehab,
Randy Dunlap, linux-kernel, David S. Miller, Greg Kroah-Hartman,
Mark Rutland, linux-arm-kernel
In-Reply-To: <1511854150-26346-1-git-send-email-yamada.masahiro@socionext.com>
On Tue, Nov 28, 2017 at 04:29:10PM +0900, Masahiro Yamada wrote:
Commit msg?
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
> Documentation/devicetree/bindings/arm/uniphier.txt | 40 ++++++++++++++++++++++
Perhaps arm/socionext/uniphier.txt instead.
> MAINTAINERS | 1 +
> 2 files changed, 41 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/arm/uniphier.txt
>
> diff --git a/Documentation/devicetree/bindings/arm/uniphier.txt b/Documentation/devicetree/bindings/arm/uniphier.txt
> new file mode 100644
> index 0000000..08d3cf3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/uniphier.txt
> @@ -0,0 +1,40 @@
> +Socionext UniPhier SoC family
> +
> +Required properties in the root node:
> + - compatible: should contain board and SoC compatible strings
> +
> + SoC compatibles:
> + - "socionext,uniphier-ld4" - LD4 SoC
> + - "socionext,uniphier-pro4" - Pro4 SoC
> + - "socionext,uniphier-sld8" - sLD8 SoC
> + - "socionext,uniphier-pro5" - Pro5 SoC
> + - "socionext,uniphier-pxs2" - PXs2 SoC
> + - "socionext,uniphier-ld6b" - LD6b SoC
> + - "socionext,uniphier-ld11" - LD11 SoC
> + - "socionext,uniphier-ld20" - LD20 SoC
> + - "socionext,uniphier-pxs3" - PXs3 SoC
Sort this? Or are these in chronological order?
> +
> + Board compatibles:
> + - "socionext,uniphier-ld4-ref" - LD4 Reference Board
> + - "socionext,uniphier-pro4-ref" - Pro4 Reference Board
> + - "socionext,uniphier-pro4-ace" - Pro4 Ace Board
> + - "socionext,uniphier-pro4-sanji" - Pro4 Sanji Board
> + - "socionext,uniphier-sld8-ref" - sLD8 Reference Board
> + - "socionext,uniphier-pxs2-gentil" - PXs2 Gentil Board
> + - "socionext,uniphier-pxs2-vodka" - PXs2 Vodka Board
> + - "socionext,uniphier-ld6b-ref" - LD6b Reference Board
> + - "socionext,uniphier-ld11-ref" - LD11 Reference Board
> + - "socionext,uniphier-ld11-global" - LD11 Global Board
> + - "socionext,uniphier-ld20-ref" - LD20 Reference Board
> + - "socionext,uniphier-ld20-global" - LD20 Global Board
> + - "socionext,uniphier-pxs3-ref" - PXs3 Reference Board
I would group boards by each SoC. Then it clear which board compatibles
go with each SoC compatible and you don't have to have the SoC name in
the board compatible.
> +
> +Example:
> +
> +/dts-v1/;
> +
> +/ {
> + compatible = "socionext,uniphier-ld20-ref", "socionext,uniphier-ld20";
> +
> + ...
> +};
> diff --git a/MAINTAINERS b/MAINTAINERS
> index cbb89bb..1fcbd65 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -2041,6 +2041,7 @@ M: Masahiro Yamada <yamada.masahiro@socionext.com>
> L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
> T: git git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier.git
> S: Maintained
> +F: Documentation/devicetree/bindings/arm/uniphier.txt
> F: Documentation/devicetree/bindings/gpio/gpio-uniphier.txt
> F: arch/arm/boot/dts/uniphier*
> F: arch/arm/include/asm/hardware/cache-uniphier.h
> --
> 2.7.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH 00/13] MIPS: add support for the Microsemi MIPS SoCs
From: Alexandre Belloni @ 2017-11-28 15:26 UTC (permalink / raw)
To: Ralf Baechle
Cc: linux-mips, linux-kernel, Alexandre Belloni, Rob Herring,
devicetree, Thomas Gleixner, Jason Cooper, Linus Walleij,
linux-gpio, Sebastian Reichel, linux-pm
Hi,
This patch series adds initial support for the Microsemi MIPS SoCs. It
is currently focusing on the Microsemi Ocelot (VSC7513, VSC7514).
It adds support for the IRQ controller, pinmux and gpio controller and
reset control.
This produces a kernel that can boot to the console.
This is a single series for reference but it can also be taken
separately by each maintainer as each drivers are independant.
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org
Cc: Sebastian Reichel <sre@kernel.org>
Cc: linux-pm@vger.kernel.org
Alexandre Belloni (13):
dt-bindings: Add vendor prefix for Microsemi Corporation
dt-bindings: interrupt-controller: Add binding for the Microsemi
Ocelot interrupt controller
irqchip: Add a driver for the Microsemi Ocelot controller
dt-bindings: pinctrl: Add bindings for Microsemi Ocelot
pinctrl: Add Microsemi Ocelot SoC driver
dt-bindings: power: reset: Document ocelot-reset binding
power: reset: Add a driver for the Microsemi Ocelot reset
dt-bindings: mips: Add bindings for Microsemi SoCs
MIPS: mscc: Add initial support for Microsemi MIPS SoCs
MIPS: mscc: add ocelot dtsi
MIPS: mscc: add ocelot PCB123 device tree
MIPS: defconfigs: add a defconfig for Microsemi SoCs
MAINTAINERS: Add entry for Microsemi MIPS SoCs
.../interrupt-controller/mscc,ocelot-icpu-intr.txt | 22 +
Documentation/devicetree/bindings/mips/mscc.txt | 6 +
.../bindings/pinctrl/mscc,ocelot-pinctrl.txt | 39 ++
.../bindings/power/reset/ocelot-reset.txt | 24 +
.../devicetree/bindings/vendor-prefixes.txt | 1 +
MAINTAINERS | 7 +
arch/mips/Kbuild.platforms | 1 +
arch/mips/Kconfig | 24 +
arch/mips/boot/dts/Makefile | 1 +
arch/mips/boot/dts/mscc/Makefile | 6 +
arch/mips/boot/dts/mscc/ocelot.dtsi | 118 +++++
arch/mips/boot/dts/mscc/ocelot_pcb123.dts | 30 ++
arch/mips/configs/mscc_defconfig | 84 ++++
arch/mips/mscc/Makefile | 11 +
arch/mips/mscc/Platform | 12 +
arch/mips/mscc/setup.c | 106 +++++
drivers/irqchip/Kconfig | 5 +
drivers/irqchip/Makefile | 1 +
drivers/irqchip/irq-mscc-ocelot.c | 109 +++++
drivers/pinctrl/Kconfig | 10 +
drivers/pinctrl/Makefile | 1 +
drivers/pinctrl/pinctrl-ocelot.c | 505 +++++++++++++++++++++
drivers/power/reset/Kconfig | 7 +
drivers/power/reset/Makefile | 1 +
drivers/power/reset/ocelot-reset.c | 87 ++++
25 files changed, 1218 insertions(+)
create mode 100644 Documentation/devicetree/bindings/interrupt-controller/mscc,ocelot-icpu-intr.txt
create mode 100644 Documentation/devicetree/bindings/mips/mscc.txt
create mode 100644 Documentation/devicetree/bindings/pinctrl/mscc,ocelot-pinctrl.txt
create mode 100644 Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
create mode 100644 arch/mips/boot/dts/mscc/Makefile
create mode 100644 arch/mips/boot/dts/mscc/ocelot.dtsi
create mode 100644 arch/mips/boot/dts/mscc/ocelot_pcb123.dts
create mode 100644 arch/mips/configs/mscc_defconfig
create mode 100644 arch/mips/mscc/Makefile
create mode 100644 arch/mips/mscc/Platform
create mode 100644 arch/mips/mscc/setup.c
create mode 100644 drivers/irqchip/irq-mscc-ocelot.c
create mode 100644 drivers/pinctrl/pinctrl-ocelot.c
create mode 100644 drivers/power/reset/ocelot-reset.c
--
2.15.0
^ permalink raw reply
* [PATCH 01/13] dt-bindings: Add vendor prefix for Microsemi Corporation
From: Alexandre Belloni @ 2017-11-28 15:26 UTC (permalink / raw)
To: Ralf Baechle
Cc: linux-mips, linux-kernel, Alexandre Belloni, Rob Herring,
devicetree
In-Reply-To: <20171128152643.20463-1-alexandre.belloni@free-electrons.com>
Microsemi Corporation provides semiconductor and system solutions for
aerospace & defense, communications, data center and industrial markets.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 0994bdd82cd3..7b880084fd37 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -219,6 +219,7 @@ motorola Motorola, Inc.
moxa Moxa Inc.
mpl MPL AG
mqmaker mqmaker Inc.
+mscc Microsemi Corporation
msi Micro-Star International Co. Ltd.
mti Imagination Technologies Ltd. (formerly MIPS Technologies Inc.)
multi-inno Multi-Inno Technology Co.,Ltd
--
2.15.0
^ permalink raw reply related
* [PATCH 02/13] dt-bindings: interrupt-controller: Add binding for the Microsemi Ocelot interrupt controller
From: Alexandre Belloni @ 2017-11-28 15:26 UTC (permalink / raw)
To: Ralf Baechle
Cc: linux-mips, linux-kernel, Alexandre Belloni, Rob Herring,
devicetree, Jason Cooper
In-Reply-To: <20171128152643.20463-1-alexandre.belloni@free-electrons.com>
Add the Device Tree binding documentation for the Microsemi Ocelot
interrupt controller that is part of the ICPU. It is connected directly to
the MIPS core interrupt controller.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
.../interrupt-controller/mscc,ocelot-icpu-intr.txt | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
create mode 100644 Documentation/devicetree/bindings/interrupt-controller/mscc,ocelot-icpu-intr.txt
diff --git a/Documentation/devicetree/bindings/interrupt-controller/mscc,ocelot-icpu-intr.txt b/Documentation/devicetree/bindings/interrupt-controller/mscc,ocelot-icpu-intr.txt
new file mode 100644
index 000000000000..b47a8a02b17b
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/mscc,ocelot-icpu-intr.txt
@@ -0,0 +1,22 @@
+Microsemi Ocelot SoC ICPU Interrupt Controller
+
+Required properties:
+
+- compatible : should be "mscc,ocelot-icpu-intr"
+- reg : Specifies base physical address and size of the registers.
+- interrupt-controller : Identifies the node as an interrupt controller
+- #interrupt-cells : Specifies the number of cells needed to encode an
+ interrupt source. The value shall be 1.
+- interrupt-parent : phandle of the CPU interrupt controller.
+- interrupts : Specifies the CPU interrupt the controller is connected to.
+
+Example:
+
+ intc: interrupt-controller@70000070 {
+ compatible = "mscc,ocelot-icpu-intr";
+ reg = <0x70000070 0x70>;
+ #interrupt-cells = <1>;
+ interrupt-controller;
+ interrupt-parent = <&cpuintc>;
+ interrupts = <2>;
+ };
--
2.15.0
^ permalink raw reply related
* [PATCH 04/13] dt-bindings: pinctrl: Add bindings for Microsemi Ocelot
From: Alexandre Belloni @ 2017-11-28 15:26 UTC (permalink / raw)
To: Ralf Baechle
Cc: linux-mips, linux-kernel, Alexandre Belloni, Rob Herring,
devicetree, linux-gpio
In-Reply-To: <20171128152643.20463-1-alexandre.belloni@free-electrons.com>
Add the documentation for the Microsemi Ocelot pinmuxing and gpio
controller.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org
.../bindings/pinctrl/mscc,ocelot-pinctrl.txt | 39 ++++++++++++++++++++++
1 file changed, 39 insertions(+)
create mode 100644 Documentation/devicetree/bindings/pinctrl/mscc,ocelot-pinctrl.txt
diff --git a/Documentation/devicetree/bindings/pinctrl/mscc,ocelot-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/mscc,ocelot-pinctrl.txt
new file mode 100644
index 000000000000..24a210e0c59a
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/mscc,ocelot-pinctrl.txt
@@ -0,0 +1,39 @@
+Microsemi Ocelot pin controller Device Tree Bindings
+----------------------------------------------------
+
+Required properties:
+ - compatible : Should be "mscc,ocelot-pinctrl"
+ - reg : Address and length of the register set for the device
+ - gpio-controller : Indicates this device is a GPIO controller
+ - #gpio-cells : Must be 2.
+ The first cell is the pin number and the
+ second cell specifies GPIO flags, as defined in
+ <dt-bindings/gpio/gpio.h>.
+ - gpio-ranges : Range of pins managed by the GPIO controller.
+
+
+The ocelot-pinctrl driver uses the generic pin multiplexing and generic pin
+configuration documented in pinctrl-bindings.txt.
+
+The following generic properties are supported:
+ - function
+ - pins
+
+Example:
+ gpio: pinctrl@71070034 {
+ compatible = "mscc,ocelot-pinctrl";
+ reg = <0x71070034 0x28>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&gpio 0 0 22>;
+
+ uart_pins: uart-pins {
+ pins = "GPIO_6", "GPIO_7";
+ function = "uart";
+ };
+
+ uart2_pins: uart2-pins {
+ pins = "GPIO_12", "GPIO_13";
+ function = "uart2";
+ };
+ };
--
2.15.0
^ permalink raw reply related
* [PATCH 06/13] dt-bindings: power: reset: Document ocelot-reset binding
From: Alexandre Belloni @ 2017-11-28 15:26 UTC (permalink / raw)
To: Ralf Baechle
Cc: linux-mips, linux-kernel, Alexandre Belloni, Rob Herring,
devicetree, linux-pm
In-Reply-To: <20171128152643.20463-1-alexandre.belloni@free-electrons.com>
Add binding documentation for the Microsemi Ocelot reset block.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
To: Sebastian Reichel <sre@kernel.org>
Cc: linux-pm@vger.kernel.org
.../bindings/power/reset/ocelot-reset.txt | 24 ++++++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
diff --git a/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt b/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
new file mode 100644
index 000000000000..2d3f2c21fadd
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/reset/ocelot-reset.txt
@@ -0,0 +1,24 @@
+Microsemi Ocelot reset driver
+
+The DEVCPU_GCB:CHIP_REGS have a SOFT_RST register that can be used to reset the
+SoC MIPS core.
+
+Required Properties:
+ - compatible: "mscc,ocelot-chip-reset"
+ - mscc,cpucontrol: phandle to the CPU system control syscon block
+
+Example:
+ cpu_ctrl: syscon@70000000 {
+ compatible = "syscon";
+ reg = <0x70000000 0x2c>;
+ };
+
+ syscon@71070000 {
+ compatible = "simple-mfd", "syscon";
+ reg = <0x71070000 0x1c>;
+
+ reset {
+ compatible = "mscc,ocelot-chip-reset";
+ mscc,cpucontrol = <&cpu_ctrl>;
+ };
+ };
--
2.15.0
^ permalink raw reply related
* [PATCH 08/13] dt-bindings: mips: Add bindings for Microsemi SoCs
From: Alexandre Belloni @ 2017-11-28 15:26 UTC (permalink / raw)
To: Ralf Baechle
Cc: linux-mips, linux-kernel, Alexandre Belloni, Rob Herring,
devicetree
In-Reply-To: <20171128152643.20463-1-alexandre.belloni@free-electrons.com>
Add bindings for Microsemi SoCs. Currently only Ocelot is supported.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
Documentation/devicetree/bindings/mips/mscc.txt | 6 ++++++
1 file changed, 6 insertions(+)
create mode 100644 Documentation/devicetree/bindings/mips/mscc.txt
diff --git a/Documentation/devicetree/bindings/mips/mscc.txt b/Documentation/devicetree/bindings/mips/mscc.txt
new file mode 100644
index 000000000000..2c52e76b7142
--- /dev/null
+++ b/Documentation/devicetree/bindings/mips/mscc.txt
@@ -0,0 +1,6 @@
+* Microsemi MIPS CPUs
+
+Required properties:
+- compatible: "brcm,ocelot"
+
+- mips-hpt-frequency: CPU counter frequency.
--
2.15.0
^ permalink raw reply related
* Re: [PATCH] dt-bindings: pinctrl: uniphier: add UniPhier pinctrl binding
From: Rob Herring @ 2017-11-28 15:27 UTC (permalink / raw)
To: Masahiro Yamada
Cc: linux-gpio, Mark Rutland, devicetree, Greg Kroah-Hartman,
Linus Walleij, Randy Dunlap, linux-kernel, Mauro Carvalho Chehab,
David S. Miller, linux-arm-kernel
In-Reply-To: <1511855386-10421-1-git-send-email-yamada.masahiro@socionext.com>
On Tue, Nov 28, 2017 at 04:49:45PM +0900, Masahiro Yamada wrote:
> The driver has been in the tree for a while, but its binding document
> is missing. Hence, here it is.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
> .../pinctrl/socionext,uniphier-pinctrl.txt | 27 ++++++++++++++++++++++
> MAINTAINERS | 1 +
> 2 files changed, 28 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/pinctrl/socionext,uniphier-pinctrl.txt
>
> diff --git a/Documentation/devicetree/bindings/pinctrl/socionext,uniphier-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/socionext,uniphier-pinctrl.txt
> new file mode 100644
> index 0000000..8173b12
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pinctrl/socionext,uniphier-pinctrl.txt
> @@ -0,0 +1,27 @@
> +UniPhier SoCs pin controller
> +
> +Required properties:
> +- compatible: should be one of the following:
> + "socionext,uniphier-ld4-pinctrl" - for LD4 SoC
> + "socionext,uniphier-pro4-pinctrl" - for Pro4 SoC
> + "socionext,uniphier-sld8-pinctrl" - for sLD8 SoC
> + "socionext,uniphier-pro5-pinctrl" - for Pro5 SoC
> + "socionext,uniphier-pxs2-pinctrl" - for PXs2 SoC
> + "socionext,uniphier-ld6b-pinctrl" - for LD6b SoC
> + "socionext,uniphier-ld11-pinctrl" - for LD11 SoC
> + "socionext,uniphier-ld20-pinctrl" - for LD20 SoC
> + "socionext,uniphier-pxs3-pinctrl" - for PXs3 SoC
> +
> +Note:
> +The UniPhier pinctrl should be a subnode of a "syscon" compatible node.
> +
> +Example:
> + soc-glue@5f800000 {
> + compatible = "socionext,uniphier-pro4-soc-glue",
> + "simple-mfd", "syscon";
> + reg = <0x5f800000 0x2000>;
> +
> + pinctrl: pinctrl {
> + compatible = "socionext,uniphier-pro4-pinctrl";
There's not a contiguous register range that can be put here?
> + };
> + };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index aa71ab52f..38b0ddc 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -2042,6 +2042,7 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
> T: git git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier.git
> S: Maintained
> F: Documentation/devicetree/bindings/gpio/gpio-uniphier.txt
> +F: Documentation/devicetree/bindings/pinctrl/socionext,uniphier-pinctrl.txt
> F: arch/arm/boot/dts/uniphier*
> F: arch/arm/include/asm/hardware/cache-uniphier.h
> F: arch/arm/mach-uniphier/
> --
> 2.7.4
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH] of: Spelling s/changset/changeset/
From: Rob Herring @ 2017-11-28 15:27 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Frank Rowand, Pantelis Antoniou,
devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1511857523-18241-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
On Tue, Nov 28, 2017 at 09:25:23AM +0100, Geert Uytterhoeven wrote:
> Signed-off-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
> ---
> drivers/of/dynamic.c | 4 ++--
> drivers/of/overlay.c | 8 ++++----
> 2 files changed, 6 insertions(+), 6 deletions(-)
Applied.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] of: overlay: Remove else after goto
From: Rob Herring @ 2017-11-28 15:28 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Frank Rowand, Pantelis Antoniou,
devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1511857593-18574-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
On Tue, Nov 28, 2017 at 09:26:33AM +0100, Geert Uytterhoeven wrote:
> If an "if" branch is terminated by a "goto", there's no need to have an
> "else" statement and an indented block of code.
>
> Remove the "else" statement to simplify the code flow for the casual
> reviewer.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
> ---
> drivers/of/overlay.c | 25 ++++++++++---------------
> 1 file changed, 10 insertions(+), 15 deletions(-)
Applied.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v3 1/3] dt-bindings: clock: add compatible variant for the Meson-AXG
From: Rob Herring @ 2017-11-28 15:29 UTC (permalink / raw)
To: Yixun Lan
Cc: Neil Armstrong, Jerome Brunet, Kevin Hilman, Mark Rutland,
Michael Turquette, Stephen Boyd, Carlo Caione, Qiufang Dai,
linux-amlogic, devicetree, linux-clk, linux-arm-kernel,
linux-kernel
In-Reply-To: <20171128125330.363-2-yixun.lan@amlogic.com>
On Tue, Nov 28, 2017 at 08:53:28PM +0800, Yixun Lan wrote:
> Update the documentation to support clock driver for the Amlogic's
> Meson-AXG SoC.
>
> Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
> ---
> Documentation/devicetree/bindings/clock/amlogic,gxbb-clkc.txt | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply
* Re: [PATCH v2 2/4] DTS: GTA04: fix panel compatibility string
From: H. Nikolaus Schaller @ 2017-11-28 15:48 UTC (permalink / raw)
To: Tony Lindgren
Cc: Mark Rutland, devicetree, linux-fbdev, letux-kernel,
Bartlomiej Zolnierkiewicz, David Airlie, Tomi Valkeinen,
dri-devel, Russell King, Rob Herring, linux-kernel, Julia Lawall,
Thierry Reding, Sean Paul, Laurent Pinchart, Benoît Cousson,
kernel, linux-omap, linux-arm-kernel
In-Reply-To: <20171128151039.GZ28152@atomide.com>
Hi Tony,
> Am 28.11.2017 um 16:10 schrieb Tony Lindgren <tony@atomide.com>:
>
> * H. Nikolaus Schaller <hns@goldelico.com> [171128 15:04]:
>> Hi Tony,
>>
>>> Am 28.11.2017 um 15:57 schrieb Tony Lindgren <tony@atomide.com>:
>>>
>>> * H. Nikolaus Schaller <hns@goldelico.com> [171116 08:53]:
>>>> Vendor string is "tpo" and not "toppoly".
>>>>
>>>> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
>>>> ---
>>>> arch/arm/boot/dts/omap3-gta04.dtsi | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/arch/arm/boot/dts/omap3-gta04.dtsi b/arch/arm/boot/dts/omap3-gta04.dtsi
>>>> index 4504908c23fe..ec27ed67a22a 100644
>>>> --- a/arch/arm/boot/dts/omap3-gta04.dtsi
>>>> +++ b/arch/arm/boot/dts/omap3-gta04.dtsi
>>>> @@ -86,7 +86,7 @@
>>>>
>>>> /* lcd panel */
>>>> lcd: td028ttec1@0 {
>>>> - compatible = "toppoly,td028ttec1";
>>>> + compatible = "tpo,td028ttec1";
>>>> reg = <0>;
>>>> spi-max-frequency = <100000>;
>>>> spi-cpol;
>>>
>>> Applying into omap-for-v4.15/fixes thanks. The other dts patch seems
>>> like it can wait for v4.16 merge window.
>>
>> Hm. Not really. It needs the panel driver to match. So either both or
>> none should be applied or it will break the panel from working.
>>
>> I am just 1-2 hours away from submitting a -v3 (rebased and tested
>> on top of 4.15-rc1).
>
> OK fine dropping both. Please update the description in both dts
> patches to make it clear they are needed as a fix. Preferrably
> with a proper fixes tag.
Well, it is not "needed" in a strong sense since current mainline&stable
works. It is more a style and consistency fix to use "tpo," everywhere.
>
> Having "We can remove the "omapdss," prefix" in the description sure
> does not sounds like it's needed as a fix :)
The description has been improved on -v3.
>
> Sounds like maybe these two should be just a single patch for
> a proper fix?
Hm. I usually get the feedback to separate DT and driver fixes into
separate commits... Therefore I submit patch sets in the hope they
are not picked apart :)
As promised -v3 is following now.
BR,
Nikolaus
^ permalink raw reply
* [PATCH v3 0/4] Fixes for omapdrm on OpenPandora and GTA04
From: H. Nikolaus Schaller @ 2017-11-28 15:48 UTC (permalink / raw)
To: Thierry Reding, David Airlie, Rob Herring, Mark Rutland,
Benoît Cousson, Tony Lindgren, Russell King, Tomi Valkeinen,
Bartlomiej Zolnierkiewicz, Laurent Pinchart, H. Nikolaus Schaller,
Julia Lawall, Sean Paul
Cc: dri-devel, devicetree, linux-kernel, linux-omap, linux-arm-kernel,
linux-fbdev, letux-kernel, kernel
Changes V3:
* stay compatible with old DTB files which still use "toppoly" (suggested by Tomi Valkeinen)
* replaced MODULE_ALIAS entries by MODULE_DEVICE_TABLE (suggested by Andrew F. Davis)
* removed DSI VDDS patch as it has already been accepted
2017-11-16 09:50:22: Changes V2:
* replaced patch to fix DSI VDDS for OMAP3 by equivalent patch from Laurent Pinchart
* keep previous compatibility option in panel driver to handle older device tree binaries
2017-11-08 22:09:36:
This patch set fixes vendor names of the panels
and fixes a problem on omapdrm with enabling
VDD_DSI for OMAP3 which is needed for displaying
the Red and Green channel on OMAP3530 (Pandora).
H. Nikolaus Schaller (4):
omapdrm: panel: fix compatible vendor string for td028ttec1
omapdrm: panel: td028ttec1: replace MODULE_ALIAS by
MODULE_DEVICE_TABLE
DTS: GTA04: fix panel compatibility string
DTS: Pandora: fix panel compatibility string
.../panel/{toppoly,td028ttec1.txt => tpo,td028ttec1.txt} | 4 ++--
arch/arm/boot/dts/omap3-gta04.dtsi | 2 +-
arch/arm/boot/dts/omap3-pandora-common.dtsi | 2 +-
drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c | 13 ++++++++++++-
.../fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c | 12 +++++++++++-
5 files changed, 27 insertions(+), 6 deletions(-)
rename Documentation/devicetree/bindings/display/panel/{toppoly,td028ttec1.txt => tpo,td028ttec1.txt} (84%)
--
2.12.2
^ permalink raw reply
* [PATCH v3 1/4] omapdrm: panel: fix compatible vendor string for td028ttec1
From: H. Nikolaus Schaller @ 2017-11-28 15:48 UTC (permalink / raw)
To: Thierry Reding, David Airlie, Rob Herring, Mark Rutland,
Benoît Cousson, Tony Lindgren, Russell King, Tomi Valkeinen,
Bartlomiej Zolnierkiewicz, Laurent Pinchart, H. Nikolaus Schaller,
Julia Lawall, Sean Paul
Cc: devicetree, linux-fbdev, letux-kernel, linux-kernel, dri-devel,
kernel, linux-omap, linux-arm-kernel
In-Reply-To: <cover.1511884135.git.hns@goldelico.com>
The vendor name was "toppoly" but other panels and the vendor list
have defined it as "tpo". So let's fix it in driver and bindings.
We keep the old definition in parallel to stay compatible with
potential older DTB setup.
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
.../display/panel/{toppoly,td028ttec1.txt => tpo,td028ttec1.txt} | 4 ++--
drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c | 3 +++
drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c | 3 +++
3 files changed, 8 insertions(+), 2 deletions(-)
rename Documentation/devicetree/bindings/display/panel/{toppoly,td028ttec1.txt => tpo,td028ttec1.txt} (84%)
diff --git a/Documentation/devicetree/bindings/display/panel/toppoly,td028ttec1.txt b/Documentation/devicetree/bindings/display/panel/tpo,td028ttec1.txt
similarity index 84%
rename from Documentation/devicetree/bindings/display/panel/toppoly,td028ttec1.txt
rename to Documentation/devicetree/bindings/display/panel/tpo,td028ttec1.txt
index 7175dc3740ac..ed34253d9fb1 100644
--- a/Documentation/devicetree/bindings/display/panel/toppoly,td028ttec1.txt
+++ b/Documentation/devicetree/bindings/display/panel/tpo,td028ttec1.txt
@@ -2,7 +2,7 @@ Toppoly TD028TTEC1 Panel
========================
Required properties:
-- compatible: "toppoly,td028ttec1"
+- compatible: "tpo,td028ttec1"
Optional properties:
- label: a symbolic name for the panel
@@ -14,7 +14,7 @@ Example
-------
lcd-panel: td028ttec1@0 {
- compatible = "toppoly,td028ttec1";
+ compatible = "tpo,td028ttec1";
reg = <0>;
spi-max-frequency = <100000>;
spi-cpol;
diff --git a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c
index 0a38a0e8c925..a0dfa14f4fab 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c
@@ -452,6 +452,8 @@ static int td028ttec1_panel_remove(struct spi_device *spi)
}
static const struct of_device_id td028ttec1_of_match[] = {
+ { .compatible = "omapdss,tpo,td028ttec1", },
+ /* keep to not break older DTB */
{ .compatible = "omapdss,toppoly,td028ttec1", },
{},
};
@@ -471,6 +473,7 @@ static struct spi_driver td028ttec1_spi_driver = {
module_spi_driver(td028ttec1_spi_driver);
+MODULE_ALIAS("spi:tpo,td028ttec1");
MODULE_ALIAS("spi:toppoly,td028ttec1");
MODULE_AUTHOR("H. Nikolaus Schaller <hns@goldelico.com>");
MODULE_DESCRIPTION("Toppoly TD028TTEC1 panel driver");
diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c
index 57e9e146ff74..4aeb908f2d1e 100644
--- a/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c
+++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c
@@ -455,6 +455,8 @@ static int td028ttec1_panel_remove(struct spi_device *spi)
}
static const struct of_device_id td028ttec1_of_match[] = {
+ { .compatible = "omapdss,tpo,td028ttec1", },
+ /* keep to not break older DTB */
{ .compatible = "omapdss,toppoly,td028ttec1", },
{},
};
@@ -474,6 +476,7 @@ static struct spi_driver td028ttec1_spi_driver = {
module_spi_driver(td028ttec1_spi_driver);
+MODULE_ALIAS("spi:tpo,td028ttec1");
MODULE_ALIAS("spi:toppoly,td028ttec1");
MODULE_AUTHOR("H. Nikolaus Schaller <hns@goldelico.com>");
MODULE_DESCRIPTION("Toppoly TD028TTEC1 panel driver");
--
2.12.2
^ permalink raw reply related
* [PATCH v3 2/4] omapdrm: panel: td028ttec1: replace MODULE_ALIAS by MODULE_DEVICE_TABLE
From: H. Nikolaus Schaller @ 2017-11-28 15:48 UTC (permalink / raw)
To: Thierry Reding, David Airlie, Rob Herring, Mark Rutland,
Benoît Cousson, Tony Lindgren, Russell King, Tomi Valkeinen,
Bartlomiej Zolnierkiewicz, Laurent Pinchart, H. Nikolaus Schaller,
Julia Lawall, Sean Paul
Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
letux-kernel-S0jZdbWzriLCfDggNXIi3w,
kernel-Jl6IXVxNIMRxAtABVqVhTwC/G2K4zDHf
In-Reply-To: <cover.1511884135.git.hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
to make it easier to keep in sync with the OF device table.
Signed-off-by: H. Nikolaus Schaller <hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
---
drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c | 12 ++++++++++--
.../video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c | 11 +++++++++--
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c
index a0dfa14f4fab..2721a86ac5e7 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c
@@ -460,9 +460,19 @@ static const struct of_device_id td028ttec1_of_match[] = {
MODULE_DEVICE_TABLE(of, td028ttec1_of_match);
+static const struct spi_device_id td028ttec1_ids[] = {
+ { "toppoly,td028ttec1", 0 },
+ { "tpo,td028ttec1", 0},
+ { /* sentinel */ }
+};
+
+MODULE_DEVICE_TABLE(spi, td028ttec1_ids);
+
+
static struct spi_driver td028ttec1_spi_driver = {
.probe = td028ttec1_panel_probe,
.remove = td028ttec1_panel_remove,
+ .id_table = td028ttec1_ids,
.driver = {
.name = "panel-tpo-td028ttec1",
@@ -473,8 +483,6 @@ static struct spi_driver td028ttec1_spi_driver = {
module_spi_driver(td028ttec1_spi_driver);
-MODULE_ALIAS("spi:tpo,td028ttec1");
-MODULE_ALIAS("spi:toppoly,td028ttec1");
MODULE_AUTHOR("H. Nikolaus Schaller <hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>");
MODULE_DESCRIPTION("Toppoly TD028TTEC1 panel driver");
MODULE_LICENSE("GPL");
diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c
index 4aeb908f2d1e..f6da8755b859 100644
--- a/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c
+++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c
@@ -463,9 +463,18 @@ static const struct of_device_id td028ttec1_of_match[] = {
MODULE_DEVICE_TABLE(of, td028ttec1_of_match);
+static const struct spi_device_id td028ttec1_ids[] = {
+ { "toppoly,td028ttec1", 0 },
+ { "tpo,td028ttec1", 0},
+ { /* sentinel */ }
+};
+
+MODULE_DEVICE_TABLE(spi, td028ttec1_ids);
+
static struct spi_driver td028ttec1_spi_driver = {
.probe = td028ttec1_panel_probe,
.remove = td028ttec1_panel_remove,
+ .id_table = td028ttec1_ids,
.driver = {
.name = "panel-tpo-td028ttec1",
@@ -476,8 +485,6 @@ static struct spi_driver td028ttec1_spi_driver = {
module_spi_driver(td028ttec1_spi_driver);
-MODULE_ALIAS("spi:tpo,td028ttec1");
-MODULE_ALIAS("spi:toppoly,td028ttec1");
MODULE_AUTHOR("H. Nikolaus Schaller <hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>");
MODULE_DESCRIPTION("Toppoly TD028TTEC1 panel driver");
MODULE_LICENSE("GPL");
--
2.12.2
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH v3 3/4] DTS: GTA04: fix panel compatibility string
From: H. Nikolaus Schaller @ 2017-11-28 15:48 UTC (permalink / raw)
To: Thierry Reding, David Airlie, Rob Herring, Mark Rutland,
Benoît Cousson, Tony Lindgren, Russell King, Tomi Valkeinen,
Bartlomiej Zolnierkiewicz, Laurent Pinchart, H. Nikolaus Schaller,
Julia Lawall, Sean Paul
Cc: dri-devel, devicetree, linux-kernel, linux-omap, linux-arm-kernel,
linux-fbdev, letux-kernel, kernel
In-Reply-To: <cover.1511884135.git.hns@goldelico.com>
Official vendor string is now "tpo" and not "toppoly".
Requires patch "omapdrm: panel: fix compatible vendor string for td028ttec1"
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
arch/arm/boot/dts/omap3-gta04.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/omap3-gta04.dtsi b/arch/arm/boot/dts/omap3-gta04.dtsi
index 4504908c23fe..ec27ed67a22a 100644
--- a/arch/arm/boot/dts/omap3-gta04.dtsi
+++ b/arch/arm/boot/dts/omap3-gta04.dtsi
@@ -86,7 +86,7 @@
/* lcd panel */
lcd: td028ttec1@0 {
- compatible = "toppoly,td028ttec1";
+ compatible = "tpo,td028ttec1";
reg = <0>;
spi-max-frequency = <100000>;
spi-cpol;
--
2.12.2
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox