pca963x           110 drivers/leds/leds-pca963x.c 	struct pca963x *chip;
pca963x           118 drivers/leds/leds-pca963x.c static int pca963x_brightness(struct pca963x_led *pca963x,
pca963x           121 drivers/leds/leds-pca963x.c 	u8 ledout_addr = pca963x->chip->chipdef->ledout_base
pca963x           122 drivers/leds/leds-pca963x.c 		+ (pca963x->led_num / 4);
pca963x           124 drivers/leds/leds-pca963x.c 	int shift = 2 * (pca963x->led_num % 4);
pca963x           128 drivers/leds/leds-pca963x.c 	ledout = i2c_smbus_read_byte_data(pca963x->chip->client, ledout_addr);
pca963x           131 drivers/leds/leds-pca963x.c 		ret = i2c_smbus_write_byte_data(pca963x->chip->client,
pca963x           136 drivers/leds/leds-pca963x.c 		ret = i2c_smbus_write_byte_data(pca963x->chip->client,
pca963x           140 drivers/leds/leds-pca963x.c 		ret = i2c_smbus_write_byte_data(pca963x->chip->client,
pca963x           141 drivers/leds/leds-pca963x.c 			PCA963X_PWM_BASE + pca963x->led_num,
pca963x           145 drivers/leds/leds-pca963x.c 		ret = i2c_smbus_write_byte_data(pca963x->chip->client,
pca963x           154 drivers/leds/leds-pca963x.c static void pca963x_blink(struct pca963x_led *pca963x)
pca963x           156 drivers/leds/leds-pca963x.c 	u8 ledout_addr = pca963x->chip->chipdef->ledout_base +
pca963x           157 drivers/leds/leds-pca963x.c 		(pca963x->led_num / 4);
pca963x           159 drivers/leds/leds-pca963x.c 	u8 mode2 = i2c_smbus_read_byte_data(pca963x->chip->client,
pca963x           161 drivers/leds/leds-pca963x.c 	int shift = 2 * (pca963x->led_num % 4);
pca963x           164 drivers/leds/leds-pca963x.c 	i2c_smbus_write_byte_data(pca963x->chip->client,
pca963x           165 drivers/leds/leds-pca963x.c 			pca963x->chip->chipdef->grppwm,	pca963x->gdc);
pca963x           167 drivers/leds/leds-pca963x.c 	i2c_smbus_write_byte_data(pca963x->chip->client,
pca963x           168 drivers/leds/leds-pca963x.c 			pca963x->chip->chipdef->grpfreq, pca963x->gfrq);
pca963x           171 drivers/leds/leds-pca963x.c 		i2c_smbus_write_byte_data(pca963x->chip->client, PCA963X_MODE2,
pca963x           174 drivers/leds/leds-pca963x.c 	mutex_lock(&pca963x->chip->mutex);
pca963x           175 drivers/leds/leds-pca963x.c 	ledout = i2c_smbus_read_byte_data(pca963x->chip->client, ledout_addr);
pca963x           177 drivers/leds/leds-pca963x.c 		i2c_smbus_write_byte_data(pca963x->chip->client, ledout_addr,
pca963x           179 drivers/leds/leds-pca963x.c 	mutex_unlock(&pca963x->chip->mutex);
pca963x           182 drivers/leds/leds-pca963x.c static int pca963x_power_state(struct pca963x_led *pca963x)
pca963x           184 drivers/leds/leds-pca963x.c 	unsigned long *leds_on = &pca963x->chip->leds_on;
pca963x           185 drivers/leds/leds-pca963x.c 	unsigned long cached_leds = pca963x->chip->leds_on;
pca963x           187 drivers/leds/leds-pca963x.c 	if (pca963x->led_cdev.brightness)
pca963x           188 drivers/leds/leds-pca963x.c 		set_bit(pca963x->led_num, leds_on);
pca963x           190 drivers/leds/leds-pca963x.c 		clear_bit(pca963x->led_num, leds_on);
pca963x           193 drivers/leds/leds-pca963x.c 		return i2c_smbus_write_byte_data(pca963x->chip->client,
pca963x           202 drivers/leds/leds-pca963x.c 	struct pca963x_led *pca963x;
pca963x           205 drivers/leds/leds-pca963x.c 	pca963x = container_of(led_cdev, struct pca963x_led, led_cdev);
pca963x           207 drivers/leds/leds-pca963x.c 	mutex_lock(&pca963x->chip->mutex);
pca963x           209 drivers/leds/leds-pca963x.c 	ret = pca963x_brightness(pca963x, value);
pca963x           212 drivers/leds/leds-pca963x.c 	ret = pca963x_power_state(pca963x);
pca963x           215 drivers/leds/leds-pca963x.c 	mutex_unlock(&pca963x->chip->mutex);
pca963x           219 drivers/leds/leds-pca963x.c static unsigned int pca963x_period_scale(struct pca963x_led *pca963x,
pca963x           222 drivers/leds/leds-pca963x.c 	unsigned int scaling = pca963x->chip->chipdef->scaling;
pca963x           230 drivers/leds/leds-pca963x.c 	struct pca963x_led *pca963x;
pca963x           234 drivers/leds/leds-pca963x.c 	pca963x = container_of(led_cdev, struct pca963x_led, led_cdev);
pca963x           245 drivers/leds/leds-pca963x.c 	period = pca963x_period_scale(pca963x, time_on + time_off);
pca963x           252 drivers/leds/leds-pca963x.c 		period = pca963x_period_scale(pca963x, 1000);
pca963x           260 drivers/leds/leds-pca963x.c 	gdc = (pca963x_period_scale(pca963x, time_on) * 256) / period;
pca963x           269 drivers/leds/leds-pca963x.c 	pca963x->gdc = gdc;
pca963x           270 drivers/leds/leds-pca963x.c 	pca963x->gfrq = gfrq;
pca963x           272 drivers/leds/leds-pca963x.c 	pca963x_blink(pca963x);
pca963x           360 drivers/leds/leds-pca963x.c 	struct pca963x *pca963x_chip;
pca963x           361 drivers/leds/leds-pca963x.c 	struct pca963x_led *pca963x;
pca963x           388 drivers/leds/leds-pca963x.c 	pca963x = devm_kcalloc(&client->dev, chip->n_leds, sizeof(*pca963x),
pca963x           390 drivers/leds/leds-pca963x.c 	if (!pca963x)
pca963x           398 drivers/leds/leds-pca963x.c 	pca963x_chip->leds = pca963x;
pca963x           405 drivers/leds/leds-pca963x.c 		pca963x[i].led_num = i;
pca963x           406 drivers/leds/leds-pca963x.c 		pca963x[i].chip = pca963x_chip;
pca963x           411 drivers/leds/leds-pca963x.c 				snprintf(pca963x[i].name,
pca963x           412 drivers/leds/leds-pca963x.c 					 sizeof(pca963x[i].name), "pca963x:%s",
pca963x           415 drivers/leds/leds-pca963x.c 				pca963x[i].led_cdev.default_trigger =
pca963x           420 drivers/leds/leds-pca963x.c 			snprintf(pca963x[i].name, sizeof(pca963x[i].name),
pca963x           424 drivers/leds/leds-pca963x.c 		pca963x[i].led_cdev.name = pca963x[i].name;
pca963x           425 drivers/leds/leds-pca963x.c 		pca963x[i].led_cdev.brightness_set_blocking = pca963x_led_set;
pca963x           428 drivers/leds/leds-pca963x.c 			pca963x[i].led_cdev.blink_set = pca963x_blink_set;
pca963x           430 drivers/leds/leds-pca963x.c 		err = led_classdev_register(&client->dev, &pca963x[i].led_cdev);
pca963x           439 drivers/leds/leds-pca963x.c 		u8 mode2 = i2c_smbus_read_byte_data(pca963x->chip->client,
pca963x           449 drivers/leds/leds-pca963x.c 		i2c_smbus_write_byte_data(pca963x->chip->client, PCA963X_MODE2,
pca963x           457 drivers/leds/leds-pca963x.c 		led_classdev_unregister(&pca963x[i].led_cdev);
pca963x           464 drivers/leds/leds-pca963x.c 	struct pca963x *pca963x = i2c_get_clientdata(client);
pca963x           467 drivers/leds/leds-pca963x.c 	for (i = 0; i < pca963x->chipdef->n_leds; i++)
pca963x           468 drivers/leds/leds-pca963x.c 		led_classdev_unregister(&pca963x->leds[i].led_cdev);