Beispiel #1
0
static int sr130pc10_sensor_write_list(struct samsung_short_t *list,int size, char *name)
{
  int ret = 0;
#ifdef CONFIG_LOAD_FILE
  ret = sr130pc10_regs_table_write(name);
#else
	int i;

  for (i = 0; i < size; i++)
  {
    if(list[i].subaddr == 0xff)
    {
      printk("<=PCAM=> now SLEEP!!!!\n");
      msleep(list[i].value*8);
    }
    else
    {
      if(sr130pc10_sensor_write(list[i].subaddr, list[i].value) < 0)
      {
        printk("<=PCAM=> sensor_write_list fail...-_-\n");
        return -1;
      }
    }
  }
#endif
	return ret;
}
static int
sr130pc10_sensor_write_list(struct sr130pc10_short_t *list,
							int size, char *name)
{
	int ret = 0;
#ifdef CONFIG_LOAD_FILE
	ret = sr130pc10_regs_table_write(name);
#else
	int i;

	pr_info("[%s] %s", __func__, name);
	for (i = 0; i < size; i++) {
		if (list[i].subaddr == 0xff) {
			printk(KERN_DEBUG "now SLEEP!!!!\n");
			msleep(list[i].value * 8);
		} else {
			if (sr130pc10_sensor_write
			    (list[i].subaddr, list[i].value) < 0) {
				printk(KERN_DEBUG
				    "sensor_write_list fail..\n");
				return -EINVAL;
			}
		}
	}
#endif
	return ret;
}
static int sr130pc10_i2c_set_config_register(struct i2c_client *client,
                                         regs_short_t reg_buffer[],
          				                 int num_of_regs,
          				                 char *name)
{
	int err = 0;

	cam_err("sr130pc10_i2c_set_config_register E: %s, %d\n",  name, err);

#ifdef CONFIG_LOAD_FILE
	err = sr130pc10_regs_table_write(client, name);
#else
	err = sr130pc10_i2c_set_data_burst(client, reg_buffer, num_of_regs);
#endif

	cam_err("sr130pc10_i2c_set_config_register X: %s, %d\n",  name, err);

	return err;
}