Lines Matching refs:ds

91 static int add_dock_dependent_device(struct dock_station *ds,  in add_dock_dependent_device()  argument
102 list_add_tail(&dd->list, &ds->dependent_devices); in add_dock_dependent_device()
152 struct dock_station *ds; in find_dock_station() local
154 list_for_each_entry(ds, &dock_stations, sibling) in find_dock_station()
155 if (ds->handle == handle) in find_dock_station()
156 return ds; in find_dock_station()
170 find_dock_dependent_device(struct dock_station *ds, struct acpi_device *adev) in find_dock_dependent_device() argument
174 list_for_each_entry(dd, &ds->dependent_devices, list) in find_dock_dependent_device()
184 struct dock_station *ds = find_dock_station(dshandle); in register_dock_dependent_device() local
186 if (ds && !find_dock_dependent_device(ds, adev)) in register_dock_dependent_device()
187 add_dock_dependent_device(ds, adev); in register_dock_dependent_device()
227 static int dock_present(struct dock_station *ds) in dock_present() argument
232 if (ds) { in dock_present()
233 status = acpi_evaluate_integer(ds->handle, "_STA", NULL, &sta); in dock_present()
244 static void hot_remove_dock_devices(struct dock_station *ds) in hot_remove_dock_devices() argument
253 list_for_each_entry_reverse(dd, &ds->dependent_devices, list) in hot_remove_dock_devices()
256 list_for_each_entry_reverse(dd, &ds->dependent_devices, list) in hot_remove_dock_devices()
270 static void hotplug_dock_devices(struct dock_station *ds, u32 event) in hotplug_dock_devices() argument
275 list_for_each_entry(dd, &ds->dependent_devices, list) in hotplug_dock_devices()
279 list_for_each_entry(dd, &ds->dependent_devices, list) in hotplug_dock_devices()
288 list_for_each_entry(dd, &ds->dependent_devices, list) { in hotplug_dock_devices()
299 static void dock_event(struct dock_station *ds, u32 event, int num) in dock_event() argument
301 struct device *dev = &ds->dock_device->dev; in dock_event()
318 list_for_each_entry(dd, &ds->dependent_devices, list) in dock_event()
332 static void handle_dock(struct dock_station *ds, int dock) in handle_dock() argument
339 acpi_handle_info(ds->handle, "%s\n", dock ? "docking" : "undocking"); in handle_dock()
346 status = acpi_evaluate_integer(ds->handle, "_DCK", &arg_list, &value); in handle_dock()
348 acpi_handle_err(ds->handle, "Failed to execute _DCK (0x%x)\n", in handle_dock()
352 static inline void dock(struct dock_station *ds) in dock() argument
354 handle_dock(ds, 1); in dock()
357 static inline void undock(struct dock_station *ds) in undock() argument
359 handle_dock(ds, 0); in undock()
362 static inline void begin_dock(struct dock_station *ds) in begin_dock() argument
364 ds->flags |= DOCK_DOCKING; in begin_dock()
367 static inline void complete_dock(struct dock_station *ds) in complete_dock() argument
369 ds->flags &= ~(DOCK_DOCKING); in complete_dock()
370 ds->last_dock_time = jiffies; in complete_dock()
373 static inline void begin_undock(struct dock_station *ds) in begin_undock() argument
375 ds->flags |= DOCK_UNDOCKING; in begin_undock()
378 static inline void complete_undock(struct dock_station *ds) in complete_undock() argument
380 ds->flags &= ~(DOCK_UNDOCKING); in complete_undock()
391 static int dock_in_progress(struct dock_station *ds) in dock_in_progress() argument
393 if ((ds->flags & DOCK_DOCKING) || in dock_in_progress()
394 time_before(jiffies, (ds->last_dock_time + HZ))) in dock_in_progress()
405 static int handle_eject_request(struct dock_station *ds, u32 event) in handle_eject_request() argument
407 if (dock_in_progress(ds)) in handle_eject_request()
417 dock_event(ds, event, UNDOCK_EVENT); in handle_eject_request()
419 hot_remove_dock_devices(ds); in handle_eject_request()
420 undock(ds); in handle_eject_request()
421 acpi_evaluate_lck(ds->handle, 0); in handle_eject_request()
422 acpi_evaluate_ej0(ds->handle); in handle_eject_request()
423 if (dock_present(ds)) { in handle_eject_request()
424 acpi_handle_err(ds->handle, "Unable to undock!\n"); in handle_eject_request()
427 complete_undock(ds); in handle_eject_request()
443 struct dock_station *ds = find_dock_station(handle); in dock_notify() local
446 if (!ds) in dock_notify()
454 if ((ds->flags & DOCK_IS_DOCK) && event == ACPI_NOTIFY_DEVICE_CHECK) in dock_notify()
469 if (!dock_in_progress(ds) && !acpi_device_enumerated(adev)) { in dock_notify()
470 begin_dock(ds); in dock_notify()
471 dock(ds); in dock_notify()
472 if (!dock_present(ds)) { in dock_notify()
474 complete_dock(ds); in dock_notify()
477 hotplug_dock_devices(ds, event); in dock_notify()
478 complete_dock(ds); in dock_notify()
479 dock_event(ds, event, DOCK_EVENT); in dock_notify()
480 acpi_evaluate_lck(ds->handle, 1); in dock_notify()
484 if (dock_present(ds) || dock_in_progress(ds)) in dock_notify()
491 begin_undock(ds); in dock_notify()
492 if ((immediate_undock && !(ds->flags & DOCK_IS_ATA)) in dock_notify()
494 handle_eject_request(ds, event); in dock_notify()
496 dock_event(ds, event, UNDOCK_EVENT); in dock_notify()
605 struct dock_station *dock_station, ds = { NULL, }; in acpi_dock_add() local
615 pdevinfo.data = &ds; in acpi_dock_add()
616 pdevinfo.size_data = sizeof(ds); in acpi_dock_add()