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
34 * struct img_ascii_lcd_ctx - Private data structure
36 * @base: the base address of the LCD registers
37 * @regmap: the regmap through which LCD registers are accessed
38 * @offset: the offset within regmap to the start of the LCD registers
50 * MIPS Boston development board
60 val = *((u64 *)&linedisp->buf[0]); in boston_update()
61 __raw_writeq(val, ctx->base); in boston_update()
63 val = *((u32 *)&linedisp->buf[0]); in boston_update()
64 __raw_writel(val, ctx->base); in boston_update()
65 val = *((u32 *)&linedisp->buf[4]); in boston_update()
66 __raw_writel(val, ctx->base + 4); in boston_update()
90 for (i = 0; i < linedisp->num_chars; i++) { in malta_update()
91 err = regmap_write(ctx->regmap, in malta_update()
92 ctx->offset + (i * 8), linedisp->buf[i]); in malta_update()
98 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 linedisp->buf[i]); in sead3_update()
200 pr_err_ratelimited("Failed to update LCD display: %d\n", err); in sead3_update()
212 { .compatible = "img,boston-lcd", .data = &boston_config },
213 { .compatible = "mti,malta-lcd", .data = &malta_config },
214 { .compatible = "mti,sead3-lcd", .data = &sead3_config },
220 * img_ascii_lcd_probe() - probe an LCD display device
221 * @pdev: the LCD platform device
223 * Probe an LCD display device, ensuring that we have the required resources in
224 * order to access the LCD & setting up private data as well as sysfs files.
226 * Return: 0 on success, else -ERRNO
230 struct device *dev = &pdev->dev; in img_ascii_lcd_probe()
237 return -ENOMEM; in img_ascii_lcd_probe()
239 if (cfg->external_regmap) { in img_ascii_lcd_probe()
240 ctx->regmap = syscon_node_to_regmap(dev->parent->of_node); in img_ascii_lcd_probe()
241 if (IS_ERR(ctx->regmap)) in img_ascii_lcd_probe()
242 return PTR_ERR(ctx->regmap); in img_ascii_lcd_probe()
244 if (of_property_read_u32(dev->of_node, "offset", &ctx->offset)) in img_ascii_lcd_probe()
245 return -EINVAL; in img_ascii_lcd_probe()
247 ctx->base = devm_platform_ioremap_resource(pdev, 0); in img_ascii_lcd_probe()
248 if (IS_ERR(ctx->base)) in img_ascii_lcd_probe()
249 return PTR_ERR(ctx->base); in img_ascii_lcd_probe()
252 err = linedisp_register(&ctx->linedisp, dev, cfg->num_chars, &cfg->ops); in img_ascii_lcd_probe()
257 err = compat_only_sysfs_link_entry_to_kobj(&dev->kobj, in img_ascii_lcd_probe()
258 &ctx->linedisp.dev.kobj, in img_ascii_lcd_probe()
267 linedisp_unregister(&ctx->linedisp); in img_ascii_lcd_probe()
272 * img_ascii_lcd_remove() - remove an LCD display device
273 * @pdev: the LCD platform device
275 * Remove an LCD display device, freeing private resources & ensuring that the
276 * driver stops using the LCD display registers.
282 sysfs_remove_link(&pdev->dev.kobj, "message"); in img_ascii_lcd_remove()
283 linedisp_unregister(&ctx->linedisp); in img_ascii_lcd_remove()
288 .name = "img-ascii-lcd",
296 MODULE_DESCRIPTION("Imagination Technologies ASCII LCD Display");