• Home
  • Raw
  • Download

Lines Matching refs:ds

71 static int add_dock_dependent_device(struct dock_station *ds,  in add_dock_dependent_device()  argument
82 list_add_tail(&dd->list, &ds->dependent_devices); in add_dock_dependent_device()
132 struct dock_station *ds; in find_dock_station() local
134 list_for_each_entry(ds, &dock_stations, sibling) in find_dock_station()
135 if (ds->handle == handle) in find_dock_station()
136 return ds; in find_dock_station()
150 find_dock_dependent_device(struct dock_station *ds, struct acpi_device *adev) in find_dock_dependent_device() argument
154 list_for_each_entry(dd, &ds->dependent_devices, list) in find_dock_dependent_device()
164 struct dock_station *ds = find_dock_station(dshandle); in register_dock_dependent_device() local
166 if (ds && !find_dock_dependent_device(ds, adev)) in register_dock_dependent_device()
167 add_dock_dependent_device(ds, adev); in register_dock_dependent_device()
207 static int dock_present(struct dock_station *ds) in dock_present() argument
212 if (ds) { in dock_present()
213 status = acpi_evaluate_integer(ds->handle, "_STA", NULL, &sta); in dock_present()
224 static void hot_remove_dock_devices(struct dock_station *ds) in hot_remove_dock_devices() argument
233 list_for_each_entry_reverse(dd, &ds->dependent_devices, list) in hot_remove_dock_devices()
237 list_for_each_entry_reverse(dd, &ds->dependent_devices, list) in hot_remove_dock_devices()
251 static void hotplug_dock_devices(struct dock_station *ds, u32 event) in hotplug_dock_devices() argument
256 list_for_each_entry(dd, &ds->dependent_devices, list) in hotplug_dock_devices()
260 list_for_each_entry(dd, &ds->dependent_devices, list) in hotplug_dock_devices()
269 list_for_each_entry(dd, &ds->dependent_devices, list) { in hotplug_dock_devices()
280 static void dock_event(struct dock_station *ds, u32 event, int num) in dock_event() argument
282 struct device *dev = &ds->dock_device->dev; in dock_event()
299 list_for_each_entry(dd, &ds->dependent_devices, list) in dock_event()
313 static void handle_dock(struct dock_station *ds, int dock) in handle_dock() argument
320 acpi_handle_info(ds->handle, "%s\n", dock ? "docking" : "undocking"); in handle_dock()
327 status = acpi_evaluate_integer(ds->handle, "_DCK", &arg_list, &value); in handle_dock()
329 acpi_handle_err(ds->handle, "Failed to execute _DCK (0x%x)\n", in handle_dock()
333 static inline void dock(struct dock_station *ds) in dock() argument
335 handle_dock(ds, 1); in dock()
338 static inline void undock(struct dock_station *ds) in undock() argument
340 handle_dock(ds, 0); in undock()
343 static inline void begin_dock(struct dock_station *ds) in begin_dock() argument
345 ds->flags |= DOCK_DOCKING; in begin_dock()
348 static inline void complete_dock(struct dock_station *ds) in complete_dock() argument
350 ds->flags &= ~(DOCK_DOCKING); in complete_dock()
351 ds->last_dock_time = jiffies; in complete_dock()
354 static inline void begin_undock(struct dock_station *ds) in begin_undock() argument
356 ds->flags |= DOCK_UNDOCKING; in begin_undock()
359 static inline void complete_undock(struct dock_station *ds) in complete_undock() argument
361 ds->flags &= ~(DOCK_UNDOCKING); in complete_undock()
372 static int dock_in_progress(struct dock_station *ds) in dock_in_progress() argument
374 if ((ds->flags & DOCK_DOCKING) || in dock_in_progress()
375 time_before(jiffies, (ds->last_dock_time + HZ))) in dock_in_progress()
386 static int handle_eject_request(struct dock_station *ds, u32 event) in handle_eject_request() argument
388 if (dock_in_progress(ds)) in handle_eject_request()
398 dock_event(ds, event, UNDOCK_EVENT); in handle_eject_request()
400 hot_remove_dock_devices(ds); in handle_eject_request()
401 undock(ds); in handle_eject_request()
402 acpi_evaluate_lck(ds->handle, 0); in handle_eject_request()
403 acpi_evaluate_ej0(ds->handle); in handle_eject_request()
404 if (dock_present(ds)) { in handle_eject_request()
405 acpi_handle_err(ds->handle, "Unable to undock!\n"); in handle_eject_request()
408 complete_undock(ds); in handle_eject_request()
424 struct dock_station *ds = find_dock_station(handle); in dock_notify() local
427 if (!ds) in dock_notify()
435 if ((ds->flags & DOCK_IS_DOCK) && event == ACPI_NOTIFY_DEVICE_CHECK) in dock_notify()
450 if (!dock_in_progress(ds) && !acpi_device_enumerated(adev)) { in dock_notify()
451 begin_dock(ds); in dock_notify()
452 dock(ds); in dock_notify()
453 if (!dock_present(ds)) { in dock_notify()
455 complete_dock(ds); in dock_notify()
458 hotplug_dock_devices(ds, event); in dock_notify()
459 complete_dock(ds); in dock_notify()
460 dock_event(ds, event, DOCK_EVENT); in dock_notify()
461 acpi_evaluate_lck(ds->handle, 1); in dock_notify()
465 if (dock_present(ds) || dock_in_progress(ds)) in dock_notify()
473 begin_undock(ds); in dock_notify()
474 if ((immediate_undock && !(ds->flags & DOCK_IS_ATA)) in dock_notify()
476 handle_eject_request(ds, event); in dock_notify()
478 dock_event(ds, event, UNDOCK_EVENT); in dock_notify()
587 struct dock_station *dock_station, ds = { NULL, }; in acpi_dock_add() local
597 pdevinfo.data = &ds; in acpi_dock_add()
598 pdevinfo.size_data = sizeof(ds); in acpi_dock_add()