drivers/staging/sm750fb/sm750_hw.c
Source file repositories/reference/linux-study-clean/drivers/staging/sm750fb/sm750_hw.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/sm750fb/sm750_hw.c- Extension
.c- Size
- 13612 bytes
- Lines
- 551
- Domain
- Driver Families
- Bucket
- drivers/staging
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/kernel.hlinux/errno.hlinux/string.hlinux/mm.hlinux/slab.hlinux/delay.hlinux/fb.hlinux/ioport.hlinux/init.hlinux/pci.hlinux/vmalloc.hlinux/pagemap.hlinux/console.hasm/mtrr.hlinux/platform_device.hlinux/sizes.hsm750.hddk750.hsm750_accel.h
Detected Declarations
function hw_sm750_mapfunction hw_sm750_inithwfunction hw_sm750_output_set_modefunction hw_sm750_crtc_check_modefunction hw_sm750_crtc_set_modefunction hw_sm750_set_col_regfunction hw_sm750le_set_blankfunction hw_sm750_set_blankfunction hw_sm750_init_accelfunction hw_sm750le_de_waitfunction hw_sm750_de_waitfunction hw_sm750_pan_display
Annotated Snippet
if (sm750_dev->nocrt) {
poke32(MISC_CTRL,
peek32(MISC_CTRL) | MISC_CTRL_DAC_POWER_OFF);
/* shut off dpms */
val = peek32(SYSTEM_CTRL) & ~SYSTEM_CTRL_DPMS_MASK;
val |= SYSTEM_CTRL_DPMS_VPHN;
poke32(SYSTEM_CTRL, val);
} else {
poke32(MISC_CTRL,
peek32(MISC_CTRL) & ~MISC_CTRL_DAC_POWER_OFF);
/* turn on dpms */
val = peek32(SYSTEM_CTRL) & ~SYSTEM_CTRL_DPMS_MASK;
val |= SYSTEM_CTRL_DPMS_VPHP;
poke32(SYSTEM_CTRL, val);
}
val = peek32(PANEL_DISPLAY_CTRL) &
~(PANEL_DISPLAY_CTRL_DUAL_DISPLAY |
PANEL_DISPLAY_CTRL_DOUBLE_PIXEL);
switch (sm750_dev->pnltype) {
case sm750_24TFT:
break;
case sm750_doubleTFT:
val |= PANEL_DISPLAY_CTRL_DOUBLE_PIXEL;
break;
case sm750_dualTFT:
val |= PANEL_DISPLAY_CTRL_DUAL_DISPLAY;
break;
}
poke32(PANEL_DISPLAY_CTRL, val);
} else {
/*
* for 750LE, no DVI chip initialization
* makes Monitor no signal
*
* Set up GPIO for software I2C to program DVI chip in the
* Xilinx SP605 board, in order to have video signal.
*/
sm750_sw_i2c_init(0, 1);
/*
* Customer may NOT use CH7301 DVI chip, which has to be
* initialized differently.
*/
if (sm750_sw_i2c_read_reg(0xec, 0x4a) == 0x95) {
/*
* The following register values for CH7301 are from
* Chrontel app note and our experiment.
*/
sm750_sw_i2c_write_reg(0xec, 0x1d, 0x16);
sm750_sw_i2c_write_reg(0xec, 0x21, 0x9);
sm750_sw_i2c_write_reg(0xec, 0x49, 0xC0);
}
}
/* init 2d engine */
if (!sm750_dev->accel_off)
hw_sm750_init_accel(sm750_dev);
return 0;
}
int hw_sm750_output_set_mode(struct lynxfb_output *output,
struct fb_var_screeninfo *var,
struct fb_fix_screeninfo *fix)
{
int ret;
enum disp_output disp_set;
int channel;
ret = 0;
disp_set = 0;
channel = *output->channel;
if (sm750_get_chip_type() != SM750LE) {
if (channel == sm750_primary) {
if (output->paths & sm750_panel)
disp_set |= do_LCD1_PRI;
if (output->paths & sm750_crt)
disp_set |= do_CRT_PRI;
} else {
if (output->paths & sm750_panel)
disp_set |= do_LCD1_SEC;
if (output->paths & sm750_crt)
disp_set |= do_CRT_SEC;
}
ddk750_set_logical_disp_out(disp_set);
} else {
/* just open DISPLAY_CONTROL_750LE register bit 3:0 */
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/errno.h`, `linux/string.h`, `linux/mm.h`, `linux/slab.h`, `linux/delay.h`, `linux/fb.h`.
- Detected declarations: `function hw_sm750_map`, `function hw_sm750_inithw`, `function hw_sm750_output_set_mode`, `function hw_sm750_crtc_check_mode`, `function hw_sm750_crtc_set_mode`, `function hw_sm750_set_col_reg`, `function hw_sm750le_set_blank`, `function hw_sm750_set_blank`, `function hw_sm750_init_accel`, `function hw_sm750le_de_wait`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.