Пример #1
0
static int
device_setup_impl(struct device_interface *di, struct s3c2410_spi *device,
                  struct resource *resources)
{
    for (; resources && (resources->type != BUS_RESOURCE && resources->type != MEMORY_RESOURCE); 
        resources = resources->next);

    if (!resources)
        return 0;

    device->main = *resources;

    device->tx.device = device;
    device->rx.device = device;
    device->tx.ops = stream_ops;
    device->rx.ops = stream_ops;

    spi_set_params(device);
    spi_config_gpio(device);

    /* TODO: do everything that is done in jbt_init_regs */

    dprintf("%s: done\n", __func__);

    return DEVICE_SUCCESS;
}
Пример #2
0
void spi_refresh_params(void) {
  int spi_num;
  int ctas;

  for (spi_num = 0; spi_num < NUM_SPI; ++spi_num) {
    for (ctas = 0; ctas < NUM_CTAR; ++ctas) {
      if (spi_conf[spi_num][ctas] != NULL) {
        spi_set_params(spi_num, ctas, spi_conf[spi_num][ctas]);
      }
    }
  }
}