In S08E05 we learn from Tyrion that apparently Bells mean surrender of a city as well.
If the city surrenders, they will ring the bells and raise the gates. Please, if you hear them ringing the bells, call off the attack.
But in S02E09, we saw:
[Baratheon Fleet Approaches King's Landing]
[Bells Toll in King's landing when Stannis' Armies are sighted]
Stannis' Man: They're welcoming the new king.
Davos: I've never known bells to mean surrender. They want to play music with us? Let's play.
Is it Tyrion who is wrong? Or Davos who got it wrong? On one hand we have a noble who would be educated on customs of surrendering. On the other we have a fighting man and commander of a ship who apparently doesn't know that bells are supposed to mean surrender. Tyrion's addendum about raising the gates doesn't necessarily mean anything because gates can be raised for a surprise attack as well.