Lines Matching +full:flash +full:- +full:mode

1 // SPDX-License-Identifier: GPL-2.0-only
4 * driving, audio power amplification, white LED flash, and generic
5 * boost conversion. Additionally it provides a 1-bit GPIO pin (out or in)
6 * and a flash synchronization pin to synchronize flash events when used as
9 * Copyright (C) 2011 ST-Ericsson SA
10 * Written on behalf of Linaro for ST-Ericsson
37 ret = regmap_read(tps6105x->regmap, TPS6105X_REG_0, &regval); in tps6105x_startup()
42 dev_info(&tps6105x->client->dev, in tps6105x_startup()
43 "TPS6105x found in SHUTDOWN mode\n"); in tps6105x_startup()
46 dev_info(&tps6105x->client->dev, in tps6105x_startup()
47 "TPS6105x found in TORCH mode\n"); in tps6105x_startup()
50 dev_info(&tps6105x->client->dev, in tps6105x_startup()
51 "TPS6105x found in FLASH mode\n"); in tps6105x_startup()
54 dev_info(&tps6105x->client->dev, in tps6105x_startup()
55 "TPS6105x found in VOLTAGE mode\n"); in tps6105x_startup()
65 * MFD cells - we always have a GPIO cell and we have one cell
66 * which is selected operation mode.
69 .name = "tps6105x-gpio",
73 .name = "tps6105x-leds",
77 .name = "tps6105x-flash",
81 .name = "tps6105x-regulator",
87 cell->platform_data = tps6105x; in tps6105x_add_device()
88 cell->pdata_size = sizeof(*tps6105x); in tps6105x_add_device()
90 return mfd_add_devices(&tps6105x->client->dev, in tps6105x_add_device()
96 struct device_node *np = dev->of_node; in tps6105x_parse_dt()
101 return ERR_PTR(-EINVAL); in tps6105x_parse_dt()
104 return ERR_PTR(-EINVAL); in tps6105x_parse_dt()
108 return ERR_PTR(-ENOMEM); in tps6105x_parse_dt()
109 pdata->mode = TPS6105X_MODE_SHUTDOWN; in tps6105x_parse_dt()
111 if (child->name && !of_node_cmp(child->name, "regulator")) in tps6105x_parse_dt()
112 pdata->mode = TPS6105X_MODE_VOLTAGE; in tps6105x_parse_dt()
113 else if (child->name && !of_node_cmp(child->name, "led")) in tps6105x_parse_dt()
114 pdata->mode = TPS6105X_MODE_TORCH; in tps6105x_parse_dt()
126 pdata = dev_get_platdata(&client->dev); in tps6105x_probe()
128 pdata = tps6105x_parse_dt(&client->dev); in tps6105x_probe()
130 dev_err(&client->dev, "No platform data or DT found"); in tps6105x_probe()
134 tps6105x = devm_kmalloc(&client->dev, sizeof(*tps6105x), GFP_KERNEL); in tps6105x_probe()
136 return -ENOMEM; in tps6105x_probe()
138 tps6105x->regmap = devm_regmap_init_i2c(client, &tps6105x_regmap_config); in tps6105x_probe()
139 if (IS_ERR(tps6105x->regmap)) in tps6105x_probe()
140 return PTR_ERR(tps6105x->regmap); in tps6105x_probe()
143 tps6105x->client = client; in tps6105x_probe()
144 tps6105x->pdata = pdata; in tps6105x_probe()
148 dev_err(&client->dev, "chip initialization failed\n"); in tps6105x_probe()
156 switch (pdata->mode) { in tps6105x_probe()
158 dev_info(&client->dev, in tps6105x_probe()
171 dev_warn(&client->dev, "invalid mode: %d\n", pdata->mode); in tps6105x_probe()
176 mfd_remove_devices(&client->dev); in tps6105x_probe()
185 mfd_remove_devices(&client->dev); in tps6105x_remove()
187 /* Put chip in shutdown mode */ in tps6105x_remove()
188 regmap_update_bits(tps6105x->regmap, TPS6105X_REG_0, in tps6105x_remove()