What's in the transmission pan? 2009 Mazda5

I have a 2009 Mazda 5 van. I hear a high pitch whirring sound coming from underneath the hood while I'm driving. it sounds like I’m driving in a lower gear. The sound starts when I step on the gas. When I let off the gas - the sound goes away, Also, this whirring sound shifts with the transmission shifts. I had a diagnostic scan done at Autozone and the diagnostic code is P0841 which indicates there is an issue with the transmission fluid pressure sensor or switch “A”. Can this P0841 code indicate something other than the fluid pressure sensor? Also, Is this sensor in the transmission pan? If so what other components can I replace while the pan is open? Thank you for any help.