drivers/input/mouse/sentelic.c
Source file repositories/reference/linux-study-clean/drivers/input/mouse/sentelic.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/input/mouse/sentelic.c- Extension
.c- Size
- 25425 bytes
- Lines
- 1068
- Domain
- Driver Families
- Bucket
- drivers/input
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/input.hlinux/input/mt.hlinux/ctype.hlinux/libps2.hlinux/serio.hlinux/jiffies.hlinux/slab.hpsmouse.hsentelic.h
Detected Declarations
function fsp_test_swap_cmdfunction fsp_test_invert_cmdfunction fsp_reg_readfunction fsp_reg_writefunction fsp_reg_write_enablefunction fsp_page_reg_readfunction fsp_page_reg_writefunction fsp_get_versionfunction fsp_get_revisionfunction fsp_get_snfunction fsp_get_buttonsfunction fsp_opc_tag_enablefunction fsp_onpad_vscrfunction fsp_onpad_hscrfunction fsp_attr_set_setregfunction fsp_attr_show_getregfunction fsp_attr_set_getregfunction fsp_attr_show_pageregfunction fsp_attr_set_pageregfunction fsp_attr_show_vscrollfunction fsp_attr_set_vscrollfunction fsp_attr_show_hscrollfunction fsp_attr_set_hscrollfunction fsp_attr_show_flagsfunction fsp_attr_set_flagsfunction fsp_attr_show_verfunction fsp_packet_debugfunction fsp_packet_debugfunction fsp_process_bytefunction fsp_activate_protocolfunction fsp_set_input_paramsfunction fsp_detectfunction fsp_resetfunction fsp_disconnectfunction fsp_reconnectfunction fsp_init
Annotated Snippet
if ((v = fsp_test_swap_cmd(reg_addr)) != reg_addr) {
/* swapping is required */
ps2_sendbyte(ps2dev, 0x77, FSP_CMD_TIMEOUT2);
} else {
/* swapping isn't necessary */
ps2_sendbyte(ps2dev, 0x55, FSP_CMD_TIMEOUT2);
}
}
/* write the register address in correct order */
ps2_sendbyte(ps2dev, v, FSP_CMD_TIMEOUT2);
if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0)
goto out;
if ((v = fsp_test_invert_cmd(reg_val)) != reg_val) {
/* inversion is required */
ps2_sendbyte(ps2dev, 0x47, FSP_CMD_TIMEOUT2);
} else if ((v = fsp_test_swap_cmd(reg_val)) != reg_val) {
/* swapping is required */
ps2_sendbyte(ps2dev, 0x44, FSP_CMD_TIMEOUT2);
} else {
/* swapping isn't necessary */
ps2_sendbyte(ps2dev, 0x33, FSP_CMD_TIMEOUT2);
}
/* write the register value in correct order */
ps2_sendbyte(ps2dev, v, FSP_CMD_TIMEOUT2);
rc = 0;
out:
ps2_end_command(ps2dev);
psmouse_dbg(psmouse,
"WRITE REG: 0x%02x to 0x%02x (rc = %d)\n",
reg_addr, reg_val, rc);
return rc;
}
/* Enable register clock gating for writing certain registers */
static int fsp_reg_write_enable(struct psmouse *psmouse, bool enable)
{
int v, nv;
if (fsp_reg_read(psmouse, FSP_REG_SYSCTL1, &v) == -1)
return -1;
if (enable)
nv = v | FSP_BIT_EN_REG_CLK;
else
nv = v & ~FSP_BIT_EN_REG_CLK;
/* only write if necessary */
if (nv != v)
if (fsp_reg_write(psmouse, FSP_REG_SYSCTL1, nv) == -1)
return -1;
return 0;
}
static int fsp_page_reg_read(struct psmouse *psmouse, int *reg_val)
{
struct ps2dev *ps2dev = &psmouse->ps2dev;
unsigned char param[3];
int rc = -1;
psmouse_deactivate(psmouse);
ps2_begin_command(ps2dev);
if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0)
goto out;
ps2_sendbyte(ps2dev, 0x66, FSP_CMD_TIMEOUT2);
ps2_sendbyte(ps2dev, 0x88, FSP_CMD_TIMEOUT2);
if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0)
goto out;
ps2_sendbyte(ps2dev, 0x83, FSP_CMD_TIMEOUT2);
ps2_sendbyte(ps2dev, 0x88, FSP_CMD_TIMEOUT2);
/* get the returned result */
if (__ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO))
goto out;
*reg_val = param[2];
rc = 0;
out:
ps2_end_command(ps2dev);
psmouse_activate(psmouse);
Annotation
- Immediate include surface: `linux/module.h`, `linux/input.h`, `linux/input/mt.h`, `linux/ctype.h`, `linux/libps2.h`, `linux/serio.h`, `linux/jiffies.h`, `linux/slab.h`.
- Detected declarations: `function fsp_test_swap_cmd`, `function fsp_test_invert_cmd`, `function fsp_reg_read`, `function fsp_reg_write`, `function fsp_reg_write_enable`, `function fsp_page_reg_read`, `function fsp_page_reg_write`, `function fsp_get_version`, `function fsp_get_revision`, `function fsp_get_sn`.
- Atlas domain: Driver Families / drivers/input.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.