]> Git Repo - linux.git/commitdiff
Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma
authorLinus Torvalds <[email protected]>
Fri, 25 May 2012 16:31:59 +0000 (09:31 -0700)
committerLinus Torvalds <[email protected]>
Fri, 25 May 2012 16:31:59 +0000 (09:31 -0700)
Pull slave-dmaengine updates from Vinod Koul:
 "Nothing exciting this time, odd fixes in a bunch of drivers"

* 'next' of git://git.infradead.org/users/vkoul/slave-dma:
  dmaengine: at_hdmac: take maxburst from slave configuration
  dmaengine: at_hdmac: remove ATC_DEFAULT_CTRLA constant
  dmaengine: at_hdmac: remove some at_dma_slave comments
  dma: imx-sdma: make channel0 operations atomic
  dmaengine: Fixup dmaengine_prep_slave_single() to be actually useful
  dmaengine: Use dma_sg_len(sg) instead of sg->length
  dmaengine: Use sg_dma_address instead of sg_phys
  DMA: PL330: Remove duplicate header file inclusion
  dma: imx-sdma: keep the callbacks invoked in the tasklet
  dmaengine: dw_dma: add Device Tree probing capability
  dmaengine: dw_dmac: Add clk_{un}prepare() support
  dma/amba-pl08x: add support for the Nomadik variant
  dma/amba-pl08x: check for terminal count status only

1  2 
arch/arm/mach-at91/at91sam9g45_devices.c
drivers/dma/coh901318.c
include/linux/dmaengine.h

index f6747246d64911ab3c61cc2a38ffd2c80c1f7fb4,a9f03f26dc15ef31a08a1ac731c0e2afaa0006ac..933fc9afe7d091db78f5484d4ca331a50cb50716
  #include <linux/i2c-gpio.h>
  #include <linux/atmel-mci.h>
  
 +#include <linux/platform_data/at91_adc.h>
 +
  #include <linux/fb.h>
  #include <video/atmel_lcdc.h>
  
 +#include <mach/at91_adc.h>
  #include <mach/board.h>
  #include <mach/at91sam9g45.h>
  #include <mach/at91sam9g45_matrix.h>
@@@ -72,7 -69,15 +72,7 @@@ static struct platform_device at_hdmac_
  
  void __init at91_add_device_hdmac(void)
  {
 -#if defined(CONFIG_OF)
 -      struct device_node *of_node =
 -              of_find_node_by_name(NULL, "dma-controller");
 -
 -      if (of_node)
 -              of_node_put(of_node);
 -      else
 -#endif
 -              platform_device_register(&at_hdmac_device);
 +      platform_device_register(&at_hdmac_device);
  }
  #else
  void __init at91_add_device_hdmac(void) {}
@@@ -122,13 -127,12 +122,13 @@@ void __init at91_add_device_usbh_ohci(s
        /* Enable VBus control for UHP ports */
        for (i = 0; i < data->ports; i++) {
                if (gpio_is_valid(data->vbus_pin[i]))
 -                      at91_set_gpio_output(data->vbus_pin[i], 0);
 +                      at91_set_gpio_output(data->vbus_pin[i],
 +                                           data->vbus_pin_active_low[i]);
        }
  
        /* Enable overcurrent notification */
        for (i = 0; i < data->ports; i++) {
 -              if (data->overcurrent_pin[i])
 +              if (gpio_is_valid(data->overcurrent_pin[i]))
                        at91_set_gpio_input(data->overcurrent_pin[i], 1);
        }
  
@@@ -184,8 -188,7 +184,8 @@@ void __init at91_add_device_usbh_ehci(s
        /* Enable VBus control for UHP ports */
        for (i = 0; i < data->ports; i++) {
                if (gpio_is_valid(data->vbus_pin[i]))
 -                      at91_set_gpio_output(data->vbus_pin[i], 0);
 +                      at91_set_gpio_output(data->vbus_pin[i],
 +                                           data->vbus_pin_active_low[i]);
        }
  
        usbh_ehci_data = *data;
@@@ -436,7 -439,6 +436,6 @@@ void __init at91_add_device_mci(short m
        atslave->dma_dev = &at_hdmac_device.dev;
        atslave->cfg = ATC_FIFOCFG_HALFFIFO
                        | ATC_SRC_H2SEL_HW | ATC_DST_H2SEL_HW;
-       atslave->ctrla = ATC_SCSIZE_16 | ATC_DCSIZE_16;
        if (mmc_id == 0)        /* MCI0 */
                atslave->cfg |= ATC_SRC_PER(AT_DMA_ID_MCI0)
                              | ATC_DST_PER(AT_DMA_ID_MCI0);
@@@ -782,9 -784,6 +781,9 @@@ void __init at91_add_device_spi(struct 
                else
                        cs_pin = spi1_standard_cs[devices[i].chip_select];
  
 +              if (!gpio_is_valid(cs_pin))
 +                      continue;
 +
                if (devices[i].bus_num == 0)
                        enable_spi0 = 1;
                else
@@@ -1089,8 -1088,25 +1088,8 @@@ static struct platform_device at91sam9g
        .num_resources  = ARRAY_SIZE(tcb1_resources),
  };
  
 -#if defined(CONFIG_OF)
 -static struct of_device_id tcb_ids[] = {
 -      { .compatible = "atmel,at91rm9200-tcb" },
 -      { /*sentinel*/ }
 -};
 -#endif
 -
  static void __init at91_add_device_tc(void)
  {
 -#if defined(CONFIG_OF)
 -      struct device_node *np;
 -
 -      np = of_find_matching_node(NULL, tcb_ids);
 -      if (np) {
 -              of_node_put(np);
 -              return;
 -      }
 -#endif
 -
        platform_device_register(&at91sam9g45_tcb0_device);
        platform_device_register(&at91sam9g45_tcb1_device);
  }
@@@ -1184,104 -1200,6 +1183,104 @@@ void __init at91_add_device_tsadcc(stru
  #endif
  
  
 +/* --------------------------------------------------------------------
 + *  ADC
 + * -------------------------------------------------------------------- */
 +
 +#if IS_ENABLED(CONFIG_AT91_ADC)
 +static struct at91_adc_data adc_data;
 +
 +static struct resource adc_resources[] = {
 +      [0] = {
 +              .start  = AT91SAM9G45_BASE_TSC,
 +              .end    = AT91SAM9G45_BASE_TSC + SZ_16K - 1,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +      [1] = {
 +              .start  = AT91SAM9G45_ID_TSC,
 +              .end    = AT91SAM9G45_ID_TSC,
 +              .flags  = IORESOURCE_IRQ,
 +      }
 +};
 +
 +static struct platform_device at91_adc_device = {
 +      .name           = "at91_adc",
 +      .id             = -1,
 +      .dev            = {
 +                              .platform_data  = &adc_data,
 +      },
 +      .resource       = adc_resources,
 +      .num_resources  = ARRAY_SIZE(adc_resources),
 +};
 +
 +static struct at91_adc_trigger at91_adc_triggers[] = {
 +      [0] = {
 +              .name = "external-rising",
 +              .value = 1,
 +              .is_external = true,
 +      },
 +      [1] = {
 +              .name = "external-falling",
 +              .value = 2,
 +              .is_external = true,
 +      },
 +      [2] = {
 +              .name = "external-any",
 +              .value = 3,
 +              .is_external = true,
 +      },
 +      [3] = {
 +              .name = "continuous",
 +              .value = 6,
 +              .is_external = false,
 +      },
 +};
 +
 +static struct at91_adc_reg_desc at91_adc_register_g45 = {
 +      .channel_base = AT91_ADC_CHR(0),
 +      .drdy_mask = AT91_ADC_DRDY,
 +      .status_register = AT91_ADC_SR,
 +      .trigger_register = 0x08,
 +};
 +
 +void __init at91_add_device_adc(struct at91_adc_data *data)
 +{
 +      if (!data)
 +              return;
 +
 +      if (test_bit(0, &data->channels_used))
 +              at91_set_gpio_input(AT91_PIN_PD20, 0);
 +      if (test_bit(1, &data->channels_used))
 +              at91_set_gpio_input(AT91_PIN_PD21, 0);
 +      if (test_bit(2, &data->channels_used))
 +              at91_set_gpio_input(AT91_PIN_PD22, 0);
 +      if (test_bit(3, &data->channels_used))
 +              at91_set_gpio_input(AT91_PIN_PD23, 0);
 +      if (test_bit(4, &data->channels_used))
 +              at91_set_gpio_input(AT91_PIN_PD24, 0);
 +      if (test_bit(5, &data->channels_used))
 +              at91_set_gpio_input(AT91_PIN_PD25, 0);
 +      if (test_bit(6, &data->channels_used))
 +              at91_set_gpio_input(AT91_PIN_PD26, 0);
 +      if (test_bit(7, &data->channels_used))
 +              at91_set_gpio_input(AT91_PIN_PD27, 0);
 +
 +      if (data->use_external_triggers)
 +              at91_set_A_periph(AT91_PIN_PD28, 0);
 +
 +      data->num_channels = 8;
 +      data->startup_time = 40;
 +      data->registers = &at91_adc_register_g45;
 +      data->trigger_number = 4;
 +      data->trigger_list = at91_adc_triggers;
 +
 +      adc_data = *data;
 +      platform_device_register(&at91_adc_device);
 +}
 +#else
 +void __init at91_add_device_adc(struct at91_adc_data *data) {}
 +#endif
 +
  /* --------------------------------------------------------------------
   *  RTT
   * -------------------------------------------------------------------- */
@@@ -1817,6 -1735,14 +1816,6 @@@ void __init at91_register_uart(unsigne
                at91_uarts[portnr] = pdev;
  }
  
 -void __init at91_set_serial_console(unsigned portnr)
 -{
 -      if (portnr < ATMEL_MAX_UART) {
 -              atmel_default_console_device = at91_uarts[portnr];
 -              at91sam9g45_set_console_clock(at91_uarts[portnr]->id);
 -      }
 -}
 -
  void __init at91_add_device_serial(void)
  {
        int i;
                if (at91_uarts[i])
                        platform_device_register(at91_uarts[i]);
        }
 -
 -      if (!atmel_default_console_device)
 -              printk(KERN_INFO "AT91: No default serial console defined.\n");
  }
  #else
  void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {}
 -void __init at91_set_serial_console(unsigned portnr) {}
  void __init at91_add_device_serial(void) {}
  #endif
  
   */
  static int __init at91_add_standard_devices(void)
  {
 +      if (of_have_populated_dt())
 +              return 0;
 +
        at91_add_device_hdmac();
        at91_add_device_rtc();
        at91_add_device_rtt();
diff --combined drivers/dma/coh901318.c
index 750925f9638bab656b39ccff65bed7dbdbee405c,c0b650c70bbdf0b7c05a22536f45fd168486d0f2..e67b4e06a918350137e8119e940618318f2c7867
@@@ -104,6 -104,13 +104,6 @@@ static void coh901318_list_print(struc
  static struct coh901318_base *debugfs_dma_base;
  static struct dentry *dma_dentry;
  
 -static int coh901318_debugfs_open(struct inode *inode, struct file *file)
 -{
 -
 -      file->private_data = inode->i_private;
 -      return 0;
 -}
 -
  static int coh901318_debugfs_read(struct file *file, char __user *buf,
                                  size_t count, loff_t *f_pos)
  {
  
  static const struct file_operations coh901318_debugfs_status_operations = {
        .owner          = THIS_MODULE,
 -      .open           = coh901318_debugfs_open,
 +      .open           = simple_open,
        .read           = coh901318_debugfs_read,
        .llseek         = default_llseek,
  };
@@@ -1033,7 -1040,7 +1033,7 @@@ coh901318_prep_slave_sg(struct dma_cha
  
        if (!sgl)
                goto out;
-       if (sgl->length == 0)
+       if (sg_dma_len(sgl) == 0)
                goto out;
  
        spin_lock_irqsave(&cohc->lock, flg);
index f9a2e5e67a5423e204389b8d01e0f83d41df1a30,0e6b595e95c886d0a318a8f95a601289ff668e4a..d3fec584e8c3e93d253fce27d910b0bafdede38b
@@@ -615,11 -615,13 +615,13 @@@ static inline int dmaengine_slave_confi
  }
  
  static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single(
-       struct dma_chan *chan, void *buf, size_t len,
+       struct dma_chan *chan, dma_addr_t buf, size_t len,
        enum dma_transfer_direction dir, unsigned long flags)
  {
        struct scatterlist sg;
-       sg_init_one(&sg, buf, len);
+       sg_init_table(&sg, 1);
+       sg_dma_address(&sg) = buf;
+       sg_dma_len(&sg) = len;
  
        return chan->device->device_prep_slave_sg(chan, &sg, 1,
                                                  dir, flags, NULL);
@@@ -974,7 -976,6 +976,7 @@@ int dma_async_device_register(struct dm
  void dma_async_device_unregister(struct dma_device *device);
  void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
  struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type);
 +struct dma_chan *net_dma_find_channel(void);
  #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y)
  
  /* --- Helper iov-locking functions --- */
This page took 0.117675 seconds and 4 git commands to generate.