Mixed arrangement with both mechanically and electromagnetically actuated valves