Simple Product
How to Get the Configurable Product of a Child in Magento2
How to Get the Configurable Product of a Child in Magento2
in order to get the Parent product of a child you will need the child product id then you can get the parent by this code