Lines Matching +full:boston +full:- +full:lcd
1 // SPDX-License-Identifier: GPL-2.0-or-later
17 #include "line-display.h"
22 * struct img_ascii_lcd_config - Configuration information about an LCD model
23 * @num_chars: the number of characters the LCD can display
25 * @update: function called to update the LCD
34 * struct img_ascii_lcd_ctx - Private data structure
35 * @base: the base address of the LCD registers
36 * @regmap: the regmap through which LCD registers are accessed
37 * @offset: the offset within regmap to the start of the LCD registers
38 * @cfg: pointer to the LCD model configuration
40 * @curr: the string currently displayed on the LCD
54 * MIPS Boston development board
64 val = *((u64 *)&ctx->curr[0]); in boston_update()
65 __raw_writeq(val, ctx->base); in boston_update()
67 val = *((u32 *)&ctx->curr[0]); in boston_update()
68 __raw_writel(val, ctx->base); in boston_update()
69 val = *((u32 *)&ctx->curr[4]); in boston_update()
70 __raw_writel(val, ctx->base + 4); in boston_update()
92 for (i = 0; i < linedisp->num_chars; i++) { in malta_update()
93 err = regmap_write(ctx->regmap, in malta_update()
94 ctx->offset + (i * 8), ctx->curr[i]); in malta_update()
100 pr_err_ratelimited("Failed to update LCD display: %d\n", err); in malta_update()
129 err = regmap_read(ctx->regmap, in sead3_wait_sm_idle()
130 ctx->offset + SEAD3_REG_CPLD_STATUS, in sead3_wait_sm_idle()
150 err = regmap_read(ctx->regmap, in sead3_wait_lcd_idle()
151 ctx->offset + SEAD3_REG_LCD_CTRL, in sead3_wait_lcd_idle()
160 err = regmap_read(ctx->regmap, in sead3_wait_lcd_idle()
161 ctx->offset + SEAD3_REG_CPLD_DATA, in sead3_wait_lcd_idle()
177 for (i = 0; i < linedisp->num_chars; i++) { in sead3_update()
182 err = regmap_write(ctx->regmap, in sead3_update()
183 ctx->offset + SEAD3_REG_LCD_CTRL, in sead3_update()
192 err = regmap_write(ctx->regmap, in sead3_update()
193 ctx->offset + SEAD3_REG_LCD_DATA, in sead3_update()
194 ctx->curr[i]); in sead3_update()
200 pr_err_ratelimited("Failed to update LCD display: %d\n", err); in sead3_update()
210 { .compatible = "img,boston-lcd", .data = &boston_config },
211 { .compatible = "mti,malta-lcd", .data = &malta_config },
212 { .compatible = "mti,sead3-lcd", .data = &sead3_config },
218 * img_ascii_lcd_probe() - probe an LCD display device
219 * @pdev: the LCD platform device
221 * Probe an LCD display device, ensuring that we have the required resources in
222 * order to access the LCD & setting up private data as well as sysfs files.
224 * Return: 0 on success, else -ERRNO
230 struct device *dev = &pdev->dev; in img_ascii_lcd_probe()
236 return -ENODEV; in img_ascii_lcd_probe()
238 cfg = match->data; in img_ascii_lcd_probe()
239 ctx = devm_kzalloc(dev, sizeof(*ctx) + cfg->num_chars, GFP_KERNEL); in img_ascii_lcd_probe()
241 return -ENOMEM; in img_ascii_lcd_probe()
243 if (cfg->external_regmap) { in img_ascii_lcd_probe()
244 ctx->regmap = syscon_node_to_regmap(dev->parent->of_node); in img_ascii_lcd_probe()
245 if (IS_ERR(ctx->regmap)) in img_ascii_lcd_probe()
246 return PTR_ERR(ctx->regmap); in img_ascii_lcd_probe()
248 if (of_property_read_u32(dev->of_node, "offset", &ctx->offset)) in img_ascii_lcd_probe()
249 return -EINVAL; in img_ascii_lcd_probe()
251 ctx->base = devm_platform_ioremap_resource(pdev, 0); in img_ascii_lcd_probe()
252 if (IS_ERR(ctx->base)) in img_ascii_lcd_probe()
253 return PTR_ERR(ctx->base); in img_ascii_lcd_probe()
256 err = linedisp_register(&ctx->linedisp, dev, cfg->num_chars, ctx->curr, in img_ascii_lcd_probe()
257 cfg->update); in img_ascii_lcd_probe()
262 err = compat_only_sysfs_link_entry_to_kobj(&dev->kobj, in img_ascii_lcd_probe()
263 &ctx->linedisp.dev.kobj, in img_ascii_lcd_probe()
272 linedisp_unregister(&ctx->linedisp); in img_ascii_lcd_probe()
277 * img_ascii_lcd_remove() - remove an LCD display device
278 * @pdev: the LCD platform device
280 * Remove an LCD display device, freeing private resources & ensuring that the
281 * driver stops using the LCD display registers.
289 sysfs_remove_link(&pdev->dev.kobj, "message"); in img_ascii_lcd_remove()
290 linedisp_unregister(&ctx->linedisp); in img_ascii_lcd_remove()
296 .name = "img-ascii-lcd",
304 MODULE_DESCRIPTION("Imagination Technologies ASCII LCD Display");