TachSensor: Support multiple fans on the same GPIO

On IBM SBP1 two fans share the same enclosure, even though they can be
controlled independently as they have two distinct I2C PWM controllers
with separate temperature sensors.
The fan enclosure occupies only one GPIO for presence detection.

Allow the same presence GPIO to be used within multiple TachSensors.

TEST: Used the same GPIO on two I2CFans, both disappear when unplugged.

Change-Id: I946e4579a361f00512eb707d2e5eb3b9ec7f2a55
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
diff --git a/src/TachSensor.hpp b/src/TachSensor.hpp
index 845fbec..15ed2e4 100644
--- a/src/TachSensor.hpp
+++ b/src/TachSensor.hpp
@@ -68,7 +68,7 @@
     TachSensor(const std::string& path, const std::string& objectType,
                sdbusplus::asio::object_server& objectServer,
                std::shared_ptr<sdbusplus::asio::connection>& conn,
-               std::unique_ptr<PresenceSensor>&& presence,
+               std::shared_ptr<PresenceSensor>& presence,
                std::optional<RedundancySensor>* redundancy,
                boost::asio::io_context& io, const std::string& fanName,
                std::vector<thresholds::Threshold>&& thresholds,
@@ -85,7 +85,7 @@
     std::array<char, 128> readBuf{};
     sdbusplus::asio::object_server& objServer;
     std::optional<RedundancySensor>* redundancy;
-    std::unique_ptr<PresenceSensor> presence;
+    std::shared_ptr<PresenceSensor> presence;
     std::shared_ptr<sdbusplus::asio::dbus_interface> itemIface;
     std::shared_ptr<sdbusplus::asio::dbus_interface> itemAssoc;
     boost::asio::random_access_file inputDev;