Skip to content

Commit 3f41762

Browse files
committed
Fix F11 control register write on resume
1 parent e23fb3a commit 3f41762

File tree

2 files changed

+12
-22
lines changed

2 files changed

+12
-22
lines changed

VoodooRMI/Functions/F11.cpp

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,14 @@ void F11::attention(AbsoluteTime time, UInt8 *data[], size_t *size)
111111

112112
int F11::config()
113113
{
114-
return f11_write_control_regs(&sens_query, &dev_controls, getQryAddr());
114+
return f11_write_control_regs(&dev_controls);
115115
}
116116

117-
int F11::f11_read_control_regs(f11_2d_ctrl *ctrl, UInt16 ctrl_base_addr)
117+
int F11::f11_read_control_regs(f11_2d_ctrl *ctrl)
118118
{
119119
int error = 0;
120120

121-
ctrl->ctrl0_11_address = ctrl_base_addr;
122-
error = readBlock(ctrl_base_addr, ctrl->ctrl0_11, RMI_F11_CTRL_REG_COUNT);
121+
error = readBlock(getCtrlAddr(), ctrl->ctrl0_11, RMI_F11_CTRL_REG_COUNT);
123122
if (error < 0) {
124123
IOLogError("Failed to read ctrl0, code: %d.", error);
125124
return error;
@@ -128,17 +127,9 @@ int F11::f11_read_control_regs(f11_2d_ctrl *ctrl, UInt16 ctrl_base_addr)
128127
return 0;
129128
}
130129

131-
int F11::f11_write_control_regs(f11_2d_sensor_queries *query,
132-
f11_2d_ctrl *ctrl,
133-
UInt16 ctrl_base_addr)
130+
int F11::f11_write_control_regs(f11_2d_ctrl *ctrl)
134131
{
135-
int error;
136-
137-
error = writeBlock(ctrl_base_addr, ctrl->ctrl0_11, RMI_F11_CTRL_REG_COUNT);
138-
if (error < 0)
139-
return error;
140-
141-
return 0;
132+
return writeBlock(getCtrlAddr(), ctrl->ctrl0_11, sizeof(ctrl->ctrl0_11));
142133
}
143134

144135
int F11::f11_2d_construct_data()
@@ -643,13 +634,15 @@ int F11::rmi_f11_initialize()
643634
if (has_acm)
644635
attn_size += nbr_fingers * 2;
645636

646-
rc = f11_read_control_regs(&dev_controls,
647-
control_base_addr);
637+
rc = f11_read_control_regs(&dev_controls);
648638
if (rc < 0) {
649639
IOLogError("Failed to read F11 control params.");
650640
return rc;
651641
}
652642

643+
/* Continuous data reporting */
644+
dev_controls.ctrl0_11[0] &= ~0x7;
645+
653646
if (sens_query.has_dribble) {
654647
// RMI_REG_STATE_OFF
655648
dev_controls.ctrl0_11[0] &= ~BIT(6);
@@ -660,8 +653,7 @@ int F11::rmi_f11_initialize()
660653
dev_controls.ctrl0_11[11] &= ~BIT(0);
661654
}
662655

663-
rc = f11_write_control_regs(&sens_query,
664-
&dev_controls, getCtrlAddr());
656+
rc = f11_write_control_regs(&dev_controls);
665657
if (rc)
666658
IOLogError("F11: Failed to write control registers");
667659

VoodooRMI/Functions/F11.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,10 +539,8 @@ class F11 : public RMITrackpadFunction {
539539
int rmi_f11_initialize();
540540
int rmi_f11_get_query_parameters(f11_2d_sensor_queries *sensor_query,
541541
UInt16 query_base_addr);
542-
int f11_read_control_regs(f11_2d_ctrl *ctrl, UInt16 ctrl_base_addr);
543-
int f11_write_control_regs(f11_2d_sensor_queries *query,
544-
f11_2d_ctrl *ctrl,
545-
UInt16 ctrl_base_addr);
542+
int f11_read_control_regs(f11_2d_ctrl *ctrl);
543+
int f11_write_control_regs(f11_2d_ctrl *ctrl);
546544
int f11_2d_construct_data();
547545

548546
inline UInt8 rmi_f11_parse_finger_state(UInt8 n_finger)

0 commit comments

Comments
 (0)